TAL Programmer's Guide

Accessing Structure Items
Using Structures
8–28 096254 Tandem Computers Incorporated
Indexing Structures You can access a particular structure item by appending indexes (enclosed in brackets)
to the various levels in the qualified identifier of the structure item. For example, you
can access an array element in a particular structure and substructure occurrence by
appending indexes as follows:
my_struct[1].my_substruct[0].my_array[4]
Each index represents an offset from the zeroth occurrence of a structure or
substructure and the zeroth element of the array, respectively, regardless of the
declared lower bounds.
The indexed item determines the size of the index offset, as listed in Table 8-6:
Table 8-6. Indexing Structures
Indexed Item Data Type Size of Index Offset
Structure or structure pointer Not applicable Total bytes in one structure occurrence
Substructure Not applicable Total bytes in one substructure
occurrence
Simple variable or array STRING Byte
Simple variable or array INT Word
Simple variable or array INT(32) or REAL Doubleword
Simple variable or array REAL(64) or FIXED Quadrupleword
Indexing Standard Indirect Structures
The index for standard indirect structures must be a signed INT arithmetic expression
in the range –32,768 through 32,767. The offset of a structure item is from the zeroth
structure occurrence (not the current structure occurrence). Here are examples of
signed INT arithmetic expressions:
25
index
index + 2
index – 1
9 * index