TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-30
Examples of DEFINETOG Directive
you use depends on whether you want settings of named toggles unchanged or turned
on or off:
You can use DEFINETOG if you are not sure the toggles were created earlier in the
compilation, possibly in a file that you sourced in. If you specify toggles that already
exist, DEFINETOG does not change their settings (as SETTOG and RESETTOG do).
Numeric Toggles
You can use a numeric toggle in an IF or IFNOT directive even if that number 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.
Examples of DEFINETOG Directive
1. This example specifies named and numeric toggles:
?DEFINETOG (debug_version, new_version, 4, 7, 11)
2. In this example, IF finds the toggle SCANNER is off and causes the compiler to
skip over the source text between IF SCANNER and ENDIF SCANNER:
?DEFINETOG scanner !Specify toggle SCANNER
!Some code here
?IF scanner !Test toggle for on state
PROC skipped; !Find it off; skip procedure
BEGIN
!More code here
END;
?ENDIF scanner !End of skipped part
3. In this example, IFNOT finds toggle EMITTER is off and causes the source text
between IFNOT EMITTER and ENDIF EMITTER to be compiled:
Directive
Setting of New
Toggle Setting of Specified Existing Toggle
DEFINETOG Off Unchanged
SETTOG On On
RESETTOG Off Off