pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Example 327 Pushing and Popping a Directive Stack
! LIST is the default setting for the source file
?PUSHLIST, NOLIST, SOURCE $SYSTEM.SYSTEM.EXTDECS (
? PROCESS_GETINFO_, FILE_OPEN_, WRITEREADX, READX)
?POPLIST
Toggles
Toggles allow these directives to effect conditional compilation:
DescriptionDirective
Specifies toggles without changing their settings. If DEFINETOG is specifying a
toggle for the first time, its setting is off.
DEFINETOG
Specifies toggles and turns them onSETTOG
Specifies toggles and turns them offRESETTOG
Begin conditional compilation, based on the value of a specified toggleIF and IFNOT
Ends conditional compilationENDIF
Topics:
• Named Toggles (page 370)
• Numeric Toggles (page 370)
• Examples (page 371)
Named Toggles
Before you use a named toggle in an IF or IFNOT directive, you must specify that name in a
DEFINETOG, SETTOG, or RESETTOG directive. Which of these directives you use depends on
whether you want the setting of the toggle to be unchanged, turned on, or turned off.
Setting
Specified Existing ToggleNew ToggleDirective
UnchangedOffDEFINETOG
OnOnSETTOG
OffOffRESETTOG
You can use DEFINETOG if you are not sure the toggles were created earlier in the compilation,
possibly in a file that you included by using a SOURCE directive. If you specify toggles that already
exist, DEFINETOG does not change their settings (as SETTOG and RESETTOG do).
Numeric Toggles
The numeric toggles are 1 through 15. All other toggles (including 16, 17, and so on) are
considered named toggles.
You can use a numeric toggle in an IF or IFNOT directive even if that toggle has not been specified
in a DEFINETOG, SETTOG, or RESETTOG directive.
By default, all numeric toggles not turned on by SETTOG are turned off. To turn off numeric toggles
turned on by SETTOG, use RESETTOG.
370 Compiler Directives