pTAL Reference Manual (H06.08+)
Structures
HP pTAL Reference Manual—523746-006
9-42
Declaring Substructures
Declaring Substructures
A substructure is a structure embedded within another structure or substructure. You
can declare substructures that have the following characteristics:
•
Substructures must be directly addressed.
•
Substructures have byte addresses, not word addresses.
•
Substructures can be nested to a maximum of 64 levels.
•
Substructures can have bounds of [n
:
n-1] (for example, [6:5]).
Topics:
•
Definition Substructures on page 9-42
•
Referral Substructures on page 9-45
Definition Substructures
A definition substructure describes a layout and allocates storage for it.
identifier
is the identifier of the definition substructure.
Example 9-34. Using a Zero-Length Array to Initialize a Structure
STRUCT s;
BEGIN
STRING a[0:-1]; ! @a[0] is the same as @b
INT b;
STRUCT t;
BEGIN
...
END;
...
END;
s.a[0] := 0;
s.a[1] := s.a[0] for $LEN(s); ! Very efficient
...
STRUCT
identifier
structure-layout
;
VST626.vsd
range
field-alignment










