TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-49
Examples of IF and ENDIF Directives
Target-System Toggle
For target-system toggles, IF causes compilation of subsequent text only if you turned
the same toggle on with TARGET.
You can specify
target-system, for example, when the code deals with the processor
state or memory management tables or other processor-specific areas.
For information on how IF, IFNOT, and ENDIF work with the TARGET directive, see the
TARGET directive, described in Section 15, Privileged Procedures
.
Compiler Listing
An asterisk (*) appears in column 10 of the listing for any statements not compiled
because of the IF or IFNOT directive.
Examples of IF and ENDIF Directives
1. In this example, DEFINETOG creates toggle OMIT and leaves it turned off. IF tests
the toggle for the on state, finds it is off, and causes the compiler to skip the source
text between IF OMIT and ENDIF OMIT:
?DEFINETOG omit !Create toggle OMIT in off state
!Some code here
?IF omit !Test toggle for on state
PROC lost; !Find it off; skip procedure
BEGIN
!More code here
END;
?ENDIF omit !End of skipped portion
2. In this example, SETTOG creates toggle KEEP and turns it on. IF tests the toggle
for the on state, finds it is on, and causes the compiler to compile the source text
between IF KEEP and ENDIF KEEP:
?SETTOG keep !Create toggle KEEP; turn it on
!Some code here
?IF keep !Test toggle for on state
PROC kept; !Find it on; compile procedure
BEGIN
!More code here
END;
?ENDIF keep !End of compiled portion