The $IFDEF directive tests for the definition of an identifier in the compiler symbol table.
$IFDEF identifier statements {$ELSE statements} $ENDIF
identifier |
Specifies the symbol to be tested. If the symbol is defined in the symbol table (by $DEFINE), the statements following the identifier are executed. If the symbol is not defined in the symbol table (by $DEFINE), the statements in the $ELSE clause are executed if specified. The $ENDIF directive is required. |
$ELSE |
(Optional) If the symbol is not defined, the statements in the $ELSE clause are executed if specified. |
$ENDIF | (Required) The $ENDIF directive marks the end of the $IFDEF directive. |
Example 1
PLATFORM
001 $DEFINE PLATFORM.D3
Example 2
TEST.IFDEF
001 $INCLUDE PLATFORM 002 $IFDEF PLATFORM.D3 003 USER.INFO = OCONV('', 'U50BB') 004 $ELSE 005 CALL !GET.USERS('', '', '',USER.INFO,'') 006 $ENDIF 007 PRINT USER.INFO