PRB: SYS(2004) Returns Incorrect Directory (140614)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
This article was previously published under Q140614 SYMPTOMS
SYS(2004) returns incorrect information. According to the online Help file,
SYS(2004) should return the name of the directory or folder from which
Visual FoxPro was started. However, if you are running several instances of
Visual FoxPro, the SYS(2004) function returns only the directory from which
the first instance was started.
CAUSE
Executable files created in Visual FoxPro are not standalone applications.
They rely on the Vfp300.esl as a runtime library. The SYS(2004) function
returns the location of this file during run time. Even if you have
multiple copies of this run-time library, the operating system will not
load several instances into memory; it only opens one copy. That is why the
SYS(2004) function only reports the location of the first one that was
started.
RESOLUTION
You can use one of the following alternate methods to obtain the startup
directory:
- Use the CURDIR() function to retrieve the working directory.
- Store the name of the startup directory in a lookup table.
- Write the location of the directory to an .ini file by using API calls.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 2/10/2000 |
---|
Keywords: | KB140614 |
---|
|