TAL Reference Manual
Compiler Directives
TAL Reference Manual—526371-001
16-83
Usage Considerations
Usage Considerations
SETTOG can appear anywhere in the source code and in the compilation command.
SETTOG without a parenthesized list must be the last directive on the line. When
SETTOG has a parenthesized list, other directives can follow on the same line, with a
comma separating the closing parenthesis from the next directive.
SETTOG interacts with the IF, IFNOT, and ENDIF directives. IF and IFNOT test the
setting of toggles and mark the beginning of conditional compilation. ENDIF marks the
end of conditional compilation.
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 settings of named toggles unchanged or turned
on or off:
Numeric Toggles
You can use a numeric toggle in an IF or IFNOT directive, even if that number has not
been specified in a SETTOG, RESETTOG, or DEFINETOG 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 SETTOG Directive
1. In this example, SETTOG turns on six toggles and RESETTOG turns off two of
them. IF tests a toggle, finds it is turned on, and causes the compiler to compile the
source text between IF VERSN2 and ENDIF VERSN2 :
?SETTOG (versn1, versn2, 7, 4, 11)
?SETTOG versn3 !Turn on toggles
?RESETTOG (versn1, 7) !Turn off toggles
!Lots of code
?IF versn2 !Test toggle for on state
PROC version_2; !Find it on; compile procedure
BEGIN
!More code
END;
?ENDIF versn2 !End of compiled portion
Directive
Setting of
New Toggle Setting of Specified Existing Toggle
DEFINETOG Off Unchanged
SETTOG On On
RESETTOG Off Off