#IF ... #ENDIF Returns Different Results in FPD and FPWID: Q108668 The information in this article applies to:
SYMPTOMSIn FoxPro for MS-DOS, if a system memory variable such as _STARTUP is stored with a value prior to compilation, _STARTUP can be evaluated with the #IF ... #ENDIF statements at compile time. In FoxPro for Windows, the #IF ... #ENDIF statements will not evaluate the system memory variable _STARTUP at compile time even though the system memory variable _STARTUP contains a value prior to compilation.
RESOLUTIONTo obtain the same results in FoxPro for Windows, add a #DEFINE preprocessor directive when you are assigning a value to the system memory variable _STARTUP. For an example, see "Workaround" in the "More Information" section below.
MORE INFORMATIONThis behavior is documented in the Help files for FoxPro for MS-DOS and FoxPro for Windows. For more information, see the "#IF ... #ENDIF Preprocessor Directive" online Help topic.
Steps to Reproduce BehaviorLoad FoxPro for MS-DOS, and then follow the steps below: 1. In the Command window, type:
2. Type the following code into the edit window, and then press CTRL+W
3. In the Command window, issue the following commands:
4. Load FoxPro for Windows and repeat steps 1-3. The #IF ... #ENDIF
WorkaroundTo obtain the same results ("TEST mode") in FoxPro for Windows, add a #DEFINE preprocessor directive when you are assigning a value to the system memory variable _STARTUP in the TEST.PRG program. For example:
If you recompile and run the TEST.PRG file, it should now return "TEST
mode" in FoxPro for Windows.
Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b compiler run time runtime KBCategory: kbenv kbprg KBSubcategory: FxenvMemory |
|
Last Reviewed: June 27, 1995 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |