Wiki Home

Vfp Start


Namespace: WIN_COM_API

See also: Config Dot FPW
Here is a simple one for beginners.
1. Create config.fpw: Modify File (Sys(2019))
asserts = on
COMMAND = DO (HOME() + "VFPSTART.PRG")

 Instead of COMMAND you can use _Startup
_Startup=HOME() + "VFPSTART.PRG")


2. Put this code in VFP's home dir: Modify Command (HOME() + "VFPSTART.PRG")
_VFP.LanguageOptions=1

Define pad UtilPad of _mSysMenu prompt "Util" key Alt+U
ON PAD UtilPad OF _MSYSMENU ACTIVATE POPUP Utils
DEFINE POPUP Utils MARGIN RELATIVE

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "Clip Error"
on selection bar CNTBAR('Utils') of Utils;
_cliptext = ExecScript( [local lae(1)]+Chr(13)+'return Iif( aerror(lae)=0, [], [Error# ]+Transform(lae(1))+[, "]+lae(2)+["  Code: ] + Message(1))' )

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT 'Reset IDE'
on selection bar CNTBAR('Utils') of Utils do d:\somedir\reset.prg

Note: you will have to put a reset.prg program in SomeDir for the Reset IDE to work. See App Shut Down for examples.

Ok.. so, here is mine -- Bob Archer

#DEFINE BOBPATH \vfp;\vfp\supercls;\vfp\stonefield\sdt;\vfp\cee6

* BOb Archer
* This is a generic start up program to establish my VFP devlopment environment

* variable needed to check if SDT menu option is already installed
local nBarCount,nCurBar,lRunSDT

CLOSE ALL
CLEAR ALL
SET CLASSLIB TO
SET ASSERTS ON

ON KEY LABEL ALT+F1 run hh.exe \vfp\books\hackfox.chm
ON KEY LABEL ALT+S do \vfp\startup.prg
ON KEY LABEL ALT+L do \vfp\clearall.prg

SET PATH TO BOBPATH

* turn on TOOLBAR
activate window STANDARD
set sysmenu to default

* -- Call COB Editor Extensions
do cee6

* -- Call Super Class and dock on bottom toolbar
supercls(,,3)

* -- Call SDT if it is not on the Tools menu!
lRunSDT = .t.
nBarCount = cntbar('_MSM_TOOLS')
for nCurBar = 1 to nBarCount
	if 'STONE' $ upper( prmbar('_MSM_TOOLS', getbar('_MSM_TOOLS',nCurBar) ) )
		lRunSDT = .f.
		exit
	endif
endfor &&* nCurBar = 1 to nVarCount
If lRunSDT
	do sdt
endif

if program(-1) > 1
	return
endif

* allow developer to set a default directory
set defa to GetDir('C:\VFP','Select the Default Directory')

if file('startcb.prg')
	DO STARTCB
	return
endif

if file('vfe.exe')
	_genmenu = addbs(curdir())+'tools\genmenux\genmenux.prg'
	do vfe.exe
	return
endif


ON KEY LABEL RIGHTMOUSE DO RightMouse.prg WITH SYS(1270)
I believe ALT-X will do this if you have supercls, also.
One line in my CONFIG.FPW is COMMAND = DO VFPSTART.PRG

This program sets up my menu with utilities I sometimes use during development. (Thanks to Erik Moore for this tip, and to Ed Leafe for making it generic with CNTBAR().)
*!*---------
LOCAL lnBar
lnBar = CNTBAR('_MTOOLS') + 1
DEFINE BAR lnBar OF _MTOOLS PROMPT "\-"
lnBar = lnBar + 1
DEFINE BAR lnBar OF _MTOOLS PROMPT "Search a string..."
ON SELECTION BAR lnBar OF _MTOOLS do ("c:\vfp_tools\searchstr\searchstring.app")
lnBar = lnBar + 1

DEFINE BAR lnBar OF _MTOOLS PROMPT "\-"
lnBar = lnBar + 1
DEFINE BAR lnBar OF _MTOOLS PROMPT [Assign "What's This Help IDs"]
ON SELECTION BAR lnBar OF _MTOOLS do ("builder.prg")
lnBar = lnBar + 1

DEFINE BAR lnBar OF _MTOOLS PROMPT [VM wizard]
ON SELECTION BAR lnBar OF _MTOOLS do (home() + "wizards\vm\vfpmodel.app")
lnBar = lnBar + 1

DEFINE BAR lnBar OF _MTOOLS PROMPT "Ask a question on UT"
ON SELECTION BAR lnBar OF _MTOOLS do startut.prg

#define DEVDRV D

_VFP.LanguageOptions=1
SET ASSERTS ON

Define pad UtilPad of _mSysMenu prompt "Util" key Alt+U
ON PAD UtilPad OF _MSYSMENU ACTIVATE POPUP Utils
DEFINE POPUP Utils MARGIN RELATIVE

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "Search a string..."
ON SELECTION BAR CNTBAR('Utils') OF Utils do DEVDRV:\foxbin\searchstring.app

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "DF's ObjRef"
on selection bar CNTBAR('Utils') of Utils DO DEVDRV:\FOXBIN\ObjRef.exe

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "ViewEdit"
on selection bar CNTBAR('Utils') of Utils DO DEVDRV:\FOXBIN\ViewEdit25

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "eView"
on selection bar CNTBAR('Utils') of Utils DO DEVDRV:\FOXBIN\eView.app

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "ER's ObjInspector(oX)"
on selection bar CNTBAR('Utils') of Utils DO DEVDRV:\FOXBIN\OI2.app with oX

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "oX=sys(1270)"
on selection bar CNTBAR('Utils') of Utils oX=sys(1270)

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "On Error Clip"
on selection bar CNTBAR('Utils') of Utils on error _cliptext = "&"+"& error #" + transform( error()) + ' "' + message() + '" Line #' + transform(lineno()) + ' "' + message(1) + '"'

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "Clip Error"
on selection bar CNTBAR('Utils') of Utils;
_cliptext = ExecScript( [local lae(1)]+Chr(13)+'return Iif( aerror(lae)=0, [], [Error# ]+Transform(lae(1))+[, "]+lae(2)+["])' )
* _cliptext = '"' + message() + '"'
* _cliptext = "error #" + transform( error()) + ' "' + message() + '"'

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "do gendbc"
on selection bar CNTBAR('Utils') of Utils Do Home(1) + "tools\gendbc\gendbc"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "do " + gete('temp')+"\runapp (Vfe app)"
on selection bar CNTBAR('Utils') of Utils do (gete('temp')+"\runapp")

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT '? [exp:], exp'
on selection bar CNTBAR('Utils') of Utils _ClipText = '? [' + _ClipText + ':], ' + _ClipText

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT '? [cmd]/n cmd'
on selection bar CNTBAR('Utils') of Utils _ClipText = '? [' + _ClipText + ']' + chr(13) + _ClipText

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT 'DT Reset'
on selection bar CNTBAR('Utils') of Utils do \dev\util\reset\reset

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT "\-"

* DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT 'Brw'
* on selection bar CNTBAR('Utils') of Utils do c:\foxbin\Brw

DEFINE BAR CNTBAR('Utils') + 1 OF Utils PROMPT 'Cut Version'
#DEFINE CR CHR(13)
LOCAL laFiles(1), lcVFP, lcHelp, lcFCapp, lcOS, lcBetaID, lcName, lcVer, lcBarCmd, laVfe(1), lcVfeVer, lcSys1001
lcVFP = version(1)
ADIR( laFiles, HOME()+"dv_foxhelp.chm" )
lcHelp = LOWER( laFiles(1) ) + " " + dtoc( laFiles(3) )
ADIR( laFiles, HOME()+"foxcode.app" )
lcFCapp = LOWER( laFiles(1) ) + " " + dtoc( laFiles(3) )
lcOS = OS(1)+" "+OS(5)+" "+OS(7)
lcBetaID = "BetaID: 435025"
lcName = "Carl Karsten"
* AGETFILEVERSION( lav, "d:\vfe7\vfe.exe" )
* lcVfeVer = "VFE ver: " + lav(4)
lcSys1001 = Sys(1001)
lcVer = lcName + CR + lcBetaID + CR + lcVFP + CR + lcHelp + CR + lcFCapp + CR + lcOS + CR + "Sys(1001) " + lcSys1001
* ;  + CR + lcVfeVer


lcBarCmd = '_cliptext = "' + lcVer + '"'
on selection bar CNTBAR('Utils') of Utils &lcBarCmd

* cd DEVDRV:\stonefield\sdt
* do sdt.app
* _genmenu = "D:\VFE7\TOOLS\GENMENUX\GENMENUX.PRG"
* _foxref = "c:\program files\microsoft visual foxpro 8\tools\xsource\vfpsource\foxref\foxref.app"
cd DEVDRV:\vfe7
do vfe
KEYBOARD "{CTRL+F2}"

cd  DEVDRV:\dev
CD


Contributors: Nancy Folsom Carl Karsten Ed Leafe
Category VFP IDE
( Topic last updated: 2006.01.26 12:26:05 PM )