pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

upper-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth substructure occurrence) of the last substructure occurrence you
want allocated. For a single-occurrence substructure, omit both bounds or specify the same
value for both bounds.
structure-layout
is the same BEGIN-END block as for structures. It can contain declarations for simple variables,
arrays, substructures, filler bits, filler bytes, redefinitions, simple pointers, and structure pointers.
The size of one substructure occurrence is the size of the layout, either in odd or even bytes.
The total layout for one occurrence of the encompassing structure must not exceed 32,767
bytes.
Example 86 Declaring Definition Substructures
STRUCT .warehouse[0:1]; ! Two warehouses
BEGIN
STRUCT inventory [0:49]; ! Definition substructure
BEGIN ! 50 items in each warehouse
INT item_number;
FIXED(2) price;
INT on_hand;
END;
END;
Referral Substructures
A referral substructure allocates storage for a substructure whose layout is the same as the layout
of a previously declared structure or structure pointer.
identifier
is the identifier of the referral substructure.
referral
is the identifier of a structure that provides the structure layout. You can specify any previously
declared structure (except the encompassing structure) or structure pointer. If the previous
structure has an odd-byte size, the compiler rounds the size of the new substructure up so that
it has an even-byte size.
range
lower-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth occurrence) of the first substructure occurrence you want
allocated. Each occurrence is one copy of the substructure.
146 Structures