pTAL Reference Manual (H06.08+)

Compiler Directives
HP pTAL Reference Manual523746-006
17-6
Named Toggles
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.
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.
Examples
Example 17-3, DEFINETOG, IF, and ENDIF Directives, on page 17-7
Example 17-4, DEFINETOG, IFNOT, and ENDIF Directives Directive, on page 17-7
Example 17-5, SETTOG, IF, and ENDIF Directives, on page 17-7
Example 17-6, SETTOG, IFNOT, and ENDIF Directives, on page 17-7
Example 17-7, SETTOG, RESETTOG, IF, and ENDIF Directives, on page 17-8
Directive
Setting
New Toggle Specified Existing Toggle
DEFINETOG Off Unchanged
SETTOG On On
RESETTOG Off Off