pTAL Reference Manual (H06.08+)
Structures
HP pTAL Reference Manual—523746-006
9-3
Structure Layout
Structure Layout
The structure layout (or body) is a BEGIN-END block that contains declarations of
structure items.
You can nest substructures within structures (that is, you can declare a substructure
within a substructure within a substructure, and so on) as deeply as the pTAL stack
allows (approximately 60 levels). The structure and each substructure has a BEGIN-
END level depending on the level of nesting.
The syntax for declaring each structure item is described after the syntax for declaring
structures. The following rules apply to all structure items:
•
You can declare the same identifier in different structures and substructures, but
you cannot repeat an identifier at the same BEGIN-END level.
•
You cannot initialize a structure item when you declare it. After you have declared
it, however, you can assign a value to it by using an assignment statement
or move
statement.
•
You can control how the compiler aligns a structure in memory and the fields of a
structure within a structure by using the FIELDALIGN clause or FIELDALIGN
compiler directive.
Definition structure and template structure declarations can optionally include a
FIELDALIGN clause. You cannot specify a FIELDALIGN clause on a referral
structure declaration.
•
If you declare a structure pointer and assign the address of a structure to it or use
a reference parameter to address structure data you can specify a REFALIGNED
clause to ensure that the structure is well-aligned.
Table 9-2. Structure Items
Structure Item Description
Simple variable A single-element variable
Array A variable that contains multiple elements of the same data type
Substructure A structure nested within a structure (to a maximum of 64 levels)
Filler byte A place-holding byte
Filler bit A place-holding bit
Simple pointer A variable that contains a memory address, usually of a simple variable
or array, which you can access with this simple pointer
Structure pointer A variable that contains the memory address of a structure, which you
can access with this structure pointer
Redefinition A new identifier and sometimes a new description for a substructure,
simple variable, array, or pointer declared in the same structure










