Database development and training for Birmingham and the midlands
Specialists in Microsoft Access and Visual Foxpro database training and development
I am happy to hear from existing clients but I am taking no new calls.
Starting Visual FoxPro
If you are working on many VFP 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:
This tells FoxPro to use the config.mkt file instead of the usual configuration file config.fpw. The FoxPro config file is a plain text file which Fox reads as it loads.
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 the config.mkt file:
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:
*-- development environment for the Marketing
*-- Clean everything up
SET SYSMENU TO DEFAULT
*-- Get rid of the standard toolbar.
*-- It's just a waste of screen space.
IF WVISIBLE ('Standard')
RELEASE WINDOW 'Standard'
*-- Make the screen green-on-black with 'Marketing'
*-- as the title.
*-- Each of my projects is a different colour so as
*-- I know where I am.
.BackColor = RGB (0, 0, 0)
.ForeColor = RGB (0, 255, 0)
*-- Reset to Courier font in a legible size.
.FontName = 'Courier New'
.FontSize = 10
.Caption = 'Marketing Development'
*-- Go to the Marketing development home directory
*-- Set the F12 key to call this program
PUSH KEY CLEAR
ON KEY LABEL f12 DO e:\devestud.458\MrktStrt.prg
*-- Open the Market project.
*-- Note the NOWAIT option.
MODIFY PROJECT ContMan NOWAIT
*-- Finally activate the Command Window
*-- (just in case it's been closed).
ACTIVATE WINDOW COMMAND
Now if you close FoxPro and click on the new shortcut, you'll be ready to start work immediately - 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 about adding controls to the FoxPro screen here.