Home About us Development Training Support |
FoxPro at development and runtimeYou do not want to be using the live data for development so you must switch between test and live data when you distribute your application. If you do this manually then there is the danger that one day you will forget. It's better to switch automatically. The problem falls into two parts:
Detecting the environmentI have used four techniques to determine whether or not the executable is running from within the development environment. Each has its advantages and drawbacks.
Switching to a new pathYou can either use the SET PATH command to tell FoxPro where to find its data files or build a fully-pathed name for each file explicitly. I prefer to use the SET PATH technique because it will apply throughout the application.There are two techniques to use with SET PATH. One is to name the data path explicitly:
IF
m.glDevMode =
.T.
*-- Use the test files in the local Data folder SET PATH TO Data ELSE *-- Use the data on network drive J SET PATH TO j:\LiveData ENDIF The other is to build (or read) the path as a string and use macro substitution:
SET PATH TO
&lcDataPath
In both cases remember that you will have to add quotes around the path if it includes spaces. |
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.
More...
|