{$IfDef | IfNDef} identifier [ statements ] $Else [ statements ] $EndIf
identifier is the identifier to test for.
With $IfDef, if identifier is defined by a prior $Define statement, all the program source lines appearing between the $IfDef statement and the closing $EndIf statement are compiled. With $IfNDef, the lines are compiled if the identifier is not defined. $IfDef and $IfNDef statements can be nested up to 10 deep.
This example shows how $Define can be used at compile time to determine whether a routine operates in a debugging mode, and how $IfDef and $IfNDef are used to control program flow accordingly:
* Set next line to $UnDefine to switch off debugging code $Define DebugMode ... $IfDef DebugMode * In debugging mode, log each time through this routine. Call DSLogInfo("Transform entered,arg1 = ":Arg1, "Test") $EndIf