pTAL Reference Manual (H06.03+)

Compiler Directives
HP pTAL Reference Manual523746-005
17-32
EXPORT_GLOBALS
EXPORT_GLOBALS
causes the compiler to define (rather than only declare) global data blocks,
allocating space for them and (optionally) giving them initial values, and causes the
linker to include in the program file all global data blocks declared up to the next
occurrence of NOEXPORT_GLOBALS or through the last declared global data
block, whichever is first.
NOEXPORT_GLOBALS
causes the compiler to declare (rather than define) global data blocks.
PUSHEXPORT_GLOBALS
pushes the current setting (EXPORT_GLOBALS or NOEXPORT_GLOBALS) onto
the EXPORT_GLOBALS directive stack. Does not change the current setting.
POPEXPORT_GLOBALS
pops the top value from the EXPORT_GLOBALS directive stack and changes the
current setting to that value.
You can export only whole data blocks. You cannot export individual variables declared
within a data block.
The compiler exports initialization values for variables that specify them. If a data block
is not being exported, the compiler ignores any specified initial values within the block.
You must export every data block in at least one compilation.
Default: EXPORT_GLOBALS
Placement:
Can appear any number of times in a compilation unit
Must appear before the first procedure is compiled
Cannot appear within BLOCK declarations
Scope: Applies to the compilation unit, except that NOEXPORT_GLOBALS
does not affect a compilation’s private data block
, which is always
exported
Dependencies:
You must specify NOEXPORT_GLOBALS when declaring a data
block that belongs to an SRL
In a compilation that includes USEGLOBALS, the compiler exports
the data blocks declared in the USEGLOBALS declarations file only
if EXPORT_GLOBALS is active when the compiler encounters the
BEGINCOMPILATION directive.
References:
BEGINCOMPILATION on page 17-19
SRL on page 17-63
USEGLOBALS on page 17-67