Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
SYS(2019) tells you where your configuration file is located. SYS(2023) tells you where temporary files are stored.
cConFigFile = SYS( 2019 )
cTempFileDir = SYS( 2023 )
The SYS(2019) function returns the path and filename of the configuration file that was read on startup. One of the best ways to get yourself totally confused is to think that you’re using one CONFIG file when, in fact, you’re using another. Visual FoxPro searches for the configuration file in this order:
A file specified using the -C startup command line option
A file specified using the FOXPROWCFG environment variable
A file named CONFIG.FPW in the current directory
A file named CONFIG.FPW anywhere along the DOS search PATH If a CONFIG.FPW is not found, Visual FoxPro is pretty vigorous about searching the path to find one, oftentimes with surprising results. Our advice: Avoid headaches and always explicitly specify a CONFIG.FPW file on startup.
SYS(2023) returns the drive and directory path where temporary files are stored.
WAIT WINDOW SYS(2019) && displays current config file
MODI COMM SYS(2019) && edits the configuration file
? SYS(2023) && displays "C:\TEMP\TMPFILES" on Ted's machine
SYS(2023) behaves differently in DOS and Windows in the 2.x products—DOS returns only the drive letter and a colon, whereas Windows returns the whole path. Because we doubt we'll see another DOS product, this has certainly become less of an issue. Just bear this in mind when converting DOS code to VFP. |
SYS(2023) returns the path to the temp file in DOS 8.3 notation, rather than using long filenames. For example, on Tamar's Windows 2000 machine, SYS(2023) returns "C:\DOCUME~1\TAMARE~1.GRA\LOCALS~1\TEMP". (Of course, we're not sure that's any worse than the unwieldy "C:\Documents and Settings\Tamar E. Granor\Local Settings\TEMP".) Since the Windows API function GetTempPath (on which this function undoubtedly calls) behaves the same way, we don't expect this one to get fixed any time soon. |