pTAL Reference Manual (H06.03+)

Compiler Directives
HP pTAL Reference Manual523746-005
17-36
IF and IFNOT
POPGP_OK
pops the top value from the GP_OK directive stack and changes the current setting
to that value.
For an explanation of directive stacks, see Directive Stacks on page 17-4.
A pTAL program that references data in a shared run-time library (SRL) must specify
NOGP_OK when it declares a data block that belongs to a shared run-time library. This
behavior prevents the pTAL compiler from using GP-relative addressing for references
to data in an SRL.
IF and IFNOT
IF and IFNOT identify the beginning of code that is to be conditionally compiled.
Default: pTAL compiler: GP_OK
EpTAL compiler: NOGP_OK
Placement: Anywhere except inside a data block or inside a procedure declaration
Scope:
GP_OK applies to subsequent code it until it is overridden by
NOGP_OK
NOGP_OK applies to subsequent code until it is overridden by
GP_OK
Dependencies: Do not use GP_OK with CALL_SHARED
References: CALL_SHARED
on page 17-21
Example 17-20. GP_OK, NOGP_OK, PUSHGP_OK, and POPGP_OK Directive
?PUSHGP_OK
?NOGP_OK
?NOEXPORT_GLOBALS
BLOCK a_block;
...
END BLOCK;
?EXPORT_GLOBALS
?POPGP_OK
VST694.vsd
pTAL
target
IF
IFNOT
toggle-number
toggle-name