pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

Example 328 DEFINETOG, IF, and ENDIF Directives
?DEFINETOG scanner ! Define toggle
...
?IF scanner ! Test toggle for on state
PROC skipped; ! Find it off, skip procedure
BEGIN
...
END;
?ENDIF scanner ! End of skipped procedure
Example 329 DEFINETOG, IFNOT, and ENDIF Directives Directive
?DEFINETOG emitter ! Define toggle
...
?IFNOT emitter ! Test toggle for off state
PROC kept; ! Find it off, compile procedure
BEGIN
...
END;
?ENDIF emitter ! End of compiled procedure
Example 330 SETTOG, IF, and ENDIF Directives
?SETTOG keep ! Create & turn on toggle
...
?IF keep ! Test toggle for on state
PROC kept; ! Find it on, compile procedure
BEGIN
...
END;
?ENDIF keep ! End of compiled procedure
Example 331 SETTOG, IFNOT, and ENDIF Directives
?SETTOG (done, nested) ! Create & turn on toggles
?IFNOT done ! Test toggle for off state
PROC skipped; ! Find it on, skip procedure
BEGIN
...
END;
?ENDIF done ! End of skipped procedure
Example 332 SETTOG, RESETTOG, IF, and ENDIF Directives
?SETTOG (versn1, versn2, 7, 4, 11) ! Turn on toggles
?SETTOG versn3 ! Turn on toggle
?RESETTOG (versn2, 7) ! Turn off toggles
...
?IF versn2 ! Test toggle for on state
PROC version_2; ! Find it off,
BEGIN ! skip procedure
...
END;
?ENDIF versn2 ! End of skipped procedure
Saving and Using Global Data Declarations
For the pTAL compiler, these directives allow you to compile and initialize global data declarations
in one compilation and use them in subsequent compilations:
DescriptionDirective
372 Compiler Directives