TAL Reference Manual

Structures
TAL Reference Manual526371-001
8-11
Example of Definition Substructure Declaration
Example of Definition Substructure Declaration
This example declares two occurrences of a structure, each of which contains 50
occurrences of a definition substructure:
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 Substructure Definition
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.
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. The default
value is 0.
VST0807.vsd
identifier
STRUCT
;
[ :
]
lower-
bound
upper-
bound
( )
referral