TAL Reference Manual

Structures
TAL Reference Manual526371-001
8-9
Usage Considerations
upper-bound
is an INT constant expression (in the range –32,768 through 32,767) that specifies
the index (relative to the zeroth array element) of the last array element you want
allocated. Both lower and upper bounds are required.
Usage Considerations
When you declare arrays inside a structure, the following guidelines apply:
You cannot initialize arrays declared in structures. You can assign values to such
arrays only by using assignment statements.
You cannot declare indirect arrays or read-only arrays in structures.
You can specify array bounds of [n : n-1] in structures as described in the TAL
Programmer’s Guide. Such an array is addressable but uses no memory.
Example of Arrays in Structures
This example declares arrays in a structure:
STRUCT record; !Declare definition structure
BEGIN
STRING name[0:19]; !Declare arrays within the
STRING addr[0:29]; ! structure layout
INT acct;
END;
Substructure Declaration
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] as described in the TAL Programmer’s
Guide. Such a substructure is addressable but uses no memory.
You can declare definition substructures or referral substructures, described next.