Microsoft KB Archive/99603

{| = PRB: #DEFINE with Equal Sign Causes a Syntax Error =
 * width="100%"|

ID: Q99603

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.5 and 2.5a
 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SYMPTOMS
In a compiled program, a constant defined with the #DEFINE clause causes a &quot;Syntax Error&quot; message when the constant is used in subsequent code snippets.

CAUSE
The #DEFINE clause was incorrectly coded. An equal sign in the #DEFINE clause results in a &quot;Syntax Error&quot; message when the constant is used in subsequent code. For example, the following code will cause the error:

#DEFINE salestax = .10 sale = 123.45 * The following line produces a syntax error. invtotal = sale * (1 + salestax)

RESOLUTION
Remove the equal sign (=) from the #DEFINE clause. Correct syntax for the #DEFINE clause is as follows:

#DEFINE salestax .10 NOTE: #DEFINE is a preprocessor directive, not a screen generator directive. Therefore, it is not listed in the generator directive section of the &quot;Developer's Guide&quot; for version 2.5.