Microsoft KB Archive/112834

{| = FIX: #IF and #ENDIF Behavior in FoxPro Differs from dBASE =
 * width="100%"|

ID: Q112834

2.60   | 2.60 WINDOWS | MS-DOS kbprg kbbuglist kbfixlist The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6
 * Microsoft FoxPro for MS-DOS, version 2.6

SYMPTOMS

 * 1) IFDEF works differently in dBASE and FoxPro. FoxPro cannot use #IFDEF and #IFNDEF. Instead, FoxPro uses #IF, which takes only a logical value or a number (0 = false, 1 = true).

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro 2.6a for Windows and MS-DOS.

RESOLUTION
To work around this problem, issue an #IF statement instead. For example:

#IF D=1 ? "TEST" #ENDIF

MORE INFORMATION
The following code demonstrates how #IFDEF works in dBASE and FoxPro:

*** #IFDEF Example *** #IFDEF d      ? "TEST" #ENDIF This code works properly in dBASE and does not print "TEST". However, in FoxPro, "TEST" is printed. This means that any dBASE code that uses #IFDEF will produce unexpected results when executed in FoxPro. Additional reference words: FoxDos FoxWin 2.60 buglist2.60 fixlist2.60a KBCategory: kbprg kbbuglist kbfixlist KBSubcategory: FxprgGeneral Solution Type : kbfix
 * }