TAL Programmer's Guide
Equivalencing Structure Pointers
Using Equivalenced Variables
096254 Tandem Computers Incorporated 10–15
Equivalencing Referral Structures to Definition Structures
You can equivalence a referral structure to a previous definition structure. In the
following example, both are standard indirect structures:
STRUCT .d_str;
BEGIN
STRING name[0:19];
STRING address [0:49];
END;
STRUCT tmp (*);
BEGIN
INT name[0:9];
INT address[0:24];
END;
STRUCT .r_str (tmp) = d_str;
ptr to D_STR
D_STR
Secondary area
316
ptr to R_STR
R_STR
.
.
.
.
.
.
.
.
.
Accessing Equivalenced Referral 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
Structure Pointers
You can equivalence a new structure pointer to a previously declared variable as
listed in Table 10-1 earlier in this section.
Be sure that you match the addressing mode of the new structure pointer and of the
previous variable as follows:
New Structure Pointer Previous Variable
Standard structure pointer Simple variable
Direct array
Standard indirect structure
Standard indirect array
Standard structure pointer
Extended structure pointer Simple variable
Direct array
Extended indirect structure
Extended indirect array
Extended structure pointer