TAL Programmer's Guide

Equivalencing Structures
Using Equivalenced Variables
10–10 096254 Tandem Computers Incorporated
Equivalencing
Definition Structures
To declare an equivalenced definition structure, specify:
The keyword STRUCT
The identifier of the new structure, often preceded by an indirection symbol
An equal sign (=)
The identifier of the previous variable
The layout of the new structure (enclosed in a BEGIN-END construct)
For portability to future software platforms, declare equivalenced variables that fit
within the previous variable.
Equivalencing Direct Structures
You can declare a directly addressed definition structure equivalent to another
directly addressed structure:
STRUCT dir1;
BEGIN
STRING name[0:20];
STRING addr[0:50];
END;
STRUCT dir2 = dir1;
BEGIN
STRING name[0:30];
STRING addr[0:40];
END;
DIR2DIR1
313
.
.
.
.
.
.
.
.
.
Equivalencing Standard Indirect Structures
You can equivalence a standard indirect definition structure to another standard
indirect structure.
For example, you can equivalence standard indirect structure STR2 equivalent to
standard indirect structure STR1:
STRUCT temp(*);
BEGIN
STRING name[0:20];
STRING addr[0:50];
END;
STRUCT .str1 (temp);
STRUCT .str2 = str1;
BEGIN
STRING name[0:30];
STRING addr[0:40];
END;
ptr to STR1
Primary area
Secondary area
314
ptr to STR2
STR2
.
.
.
STR1
.
.
.
.
.
.
.
.
.