Home(), Sys(2004), FullName
Until VFP 6, the two functions here were identical. With no parameters (or no additional parameters for SYS(2004)), they both return the directory from which Visual FoxPro was started. Obviously, the mnemonic HOME() is a better choice than the mysterious SYS(2004) (despite the fact that SYS(2004) is burned in our brains). VFP 6 added a number of alternate uses for HOME() to let us find various other directories, and VFP 7 added yet another.FullName, a property of the VFP Application object, is the Automation Server version of the same information—it gives you both the full path to the directory and the name of the executable that started the VFP session in question.
Usage |
cHomeDirectory = HOME( [ nWhichDir ] ) cHomeDirectory = SYS( 2004 ) cStartingEXE = appApplication.FullName |
Parameter |
Value |
Meaning |
nWhichDir |
Omitted |
Return the directory from which VFP was started. For the development environment, this is the location of VFP.EXE; for a runtime application, it's the location of the runtime files. |
1 |
Return the root directory of the VFP directory tree—in other words, the directory into which VFP was installed. |
|
2 |
Return the directory to which the VFP samples were installed. Same as _SAMPLES. |
|
3 |
Return the Common subdirectory of the Visual Studio installation. |
|
4 |
In VFP 6, return the Common\Graphics subdirectory of the Visual Studio installation. In VFP 7 and later, return the Graphics directory of the VFP installation. |
|
5 |
Return the samples directory of the Visual Studio/MSDN installation. |
|
6 |
Return the Common\Tools directory of the Visual Studio installation. |
|
7 |
Return the "user application data" directory—that is, the directory where Windows thinks it should store data for the application. In Windows 2000, this is, by default, C:\Documents and Settings\<user name>\Application Data\Microsoft\Visual FoxPro\. This was added in VFP 7. |
Example |
WAIT WINDOW "Support files are in " + HOME() WAIT WINDOW "This app is running from " + ; JustPath(SYS(16,1)) * Find out about the application object in the current session * though it's far more likely you'll be doing this in another * Automation client. ? _VFP.FullName * Use a bitmap file. _SCREEN.Picture = HOME(4)+"BITMAPS\ASSORTED\BALLOON.BMP" |
See Also |
Application, Configuration Files, _FoxCode, _FoxTask, FoxTools, JustPath(), _Samples, Sys(16), Version, _VFP |