Starting FoxPro


If you are working on many Fox projects at once then it's useful to have separate icons for each one on the desktop. Use FoxPro's -c startup switch to make each of these shortcuts lead to a different project.

Create a new shortcut to VFP.Exe on the desktop and add the -c switch to the program name:

'D:\Visual Studio\Vfp98\VFP6.EXE' -cconfig.mkt

This tells Fox to use the config.mkt file instead of the usual configuration file config.fpw.

You can set development options in the config file itself but it's better to just use the config file to run a program. You can then run this same program to reset your development environment during testing.

Put the following line in config.mkt:

COMMAND = DO e:\devestud.458\MrktStrt.Prg

Note that the program name is fully-pathed. You'll see the reason for this later.

Now you need to write the startup program itself:

*-- Startup program called by Config.mkt to load Marketing
*-- development environment
*-- Clean everything up
CLEAR MEMORY
CLOSE DATA
CLEAR ALL
CLOSE ALL
SET SYSMENU TO DEFAULT

*-- Get rid of the standard toolbar
IF WVISIBLE ('Standard')
   RELEASE WINDOW 'Standard'
ENDIF

*-- Make the screen green-on-black with a Marketing title
WITH _SCREEN
   .BackColor = RGB (0, 0, 0)
   .ForeColor = RGB (0, 255, 0)
   .FontName = 'Courier New'
   .FontSize = 10
   .Caption = 'Marketing Development'
   .cls
ENDWITH

*-- Go to the Marketing development directory
CD e:\devestud.458\Dev

*-- Set F12 to run this program
PUSH KEY CLEAR
ON KEY LABEL f12 DO e:\devestud.458\MrktStrt.prg

*-- Open the Market project ...
MODIFY PROJECT ContMan NOWAIT

*-- ... and activate the Command Window
ACTIVATE WINDOW COMMAND

Now if you close FoxPro and click on the new shortcut, you'll be ready to start work - in the right directory with the right project open. The screen caption will remind you what project you're working on today and whenever your test runs fail to clean up correctly you'll be able to press F12 to reset the environment .

FoxPro has a very open architecture with all the details documented in the Help system or on-line and there is no real limit to what can you can do to make the environment more comfortable and productive. You can manipulate the _screen object to add controls to the desktop. More details here .

Back to FoxPro Developers' page


Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map