TAL Programmer's Guide

Equivalencing Structures
Using Equivalenced Variables
10–14 096254 Tandem Computers Incorporated
Avoid equivalencing a direct structure to an indirect variable, because the direct
structure is not equivalenced to the indirect structure. Avoid the following practice:
Secondary area
STRUCT .ind_str;
BEGIN
STRING a[0:19];
STRING b[0:49];
END;
STRUCT dir_str = ind_str;
BEGIN
INT a[0:9];
INT b[0:24];
END;
402
DIR_STR
.
.
.
ptr to IND_STR
IND_STR
Primary area
.
.
.
Accessing Equivalenced Definition Structures
You access equivalenced definition structures as you do any other structure. That is,
you qualify the structure name with the appropriate structure items, as described in
Section 8, “Using Structures.”
Equivalencing
Referral Structures
To declare an equivalenced referral structure, specify:
The keyword STRUCT
The identifier of the new structure, often preceded by an indirection symbol
A referral that associates the new structure with a structure layout—enclose in
parentheses the identifier of a previously declared structure or structure pointer
An equal sign (=)
The identifier of the previous variable
For portability to future software platforms, declare equivalenced variables that fit
within the previous variable.
All other equivalencing guidelines described for equivalenced definition structures
apply to equivalenced referral structures.