PRB: SYS(2004) Returns Incorrect DirectoryID: Q140614 3.00 WINDOWS kbprg kbprb The information in this article applies to:
SYMPTOMSSYS(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.
CAUSEExecutable 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.
RESOLUTIONYou can use one of the following alternate methods to obtain the startup directory:
STATUSThis behavior is by design.
MORE INFORMATIONFor information about an alternative method of obtaining the path to the installation, please see the following article in the Microsoft Knowledge Base:
Steps to Reproduce Behavior1. Create a program file that contains the following line repeated twice:
2. Add this program to a new project, and build an executable.
3. Create a second, new project and add the same program to it. 4. Copy the Vfp300.esl file into both of the directories, or place the
5. Create icons for each of the executables, and set the working
6. Try running each application separately. The WAIT WINDOW will
7. Close the executables if they are open.
8. Start one of the executables. While it is waiting for you to press a Additional reference words: 3.00 VFoxWin
KBCategory: kbprg kbprb
KBSubcategory: FxprgGeneral
|
Last Reviewed: January 23, 1996 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |