$IFDEF Statement
Controls conditional compilation of source code.
Syntax
$IFDEF
symbol
statement
.
.
.
{$ELSE
statement
.
.
.}
$ENDIF
Syntax Elements
symbol The name of a symbol.
statement Any valid DataBasic statement.
Conditions
When the module is compiled:
-
If symbol has been defined using the $DEFINE or EQUATE statement, the statement(s) following $IFDEF symbol are included. If a $ELSE clause is present, those following $ELSE are excluded.
-
If symbol has not been defined, the statement(s) following $IFDEF symbol are excluded. If a $ELSE clause is present, the statement(s) following $ELSE are included.
Comments
Any number of valid DataBasic statements can be included or excluded following a $IFDEF or $ELSE.
The $IFDEF statement (with or without $ELSE) must be terminated with $ENDIF.
See Also
$IFNDEF statement, $DEFINE statement, EQUATE statement, $UNDEFINE statement.
Example
$IFDEF DEBUG
PRINT COUNT, MYVALUE
$ENDIF
If the symbol DEBUG has been defined, code that prints the values of the COUNT and MYVALUE variables is included; otherwise this line is omitted.