TACL Reference Manual

Variables
HP NonStop TACL Reference Manual429513-018
4-21
Declaring FILLER Bytes
Sample STRUCT Declarations
These examples illustrate several STRUCT declarations.
1. This example declares a two-dimensional array. It consists of two occurrences of a
substructure, each of which contains 50 occurrences of a substructure.
[#DEF buildings STRUCT
BEGIN
STRUCT warehouse (0:1);
BEGIN
STRUCT inventory (0:49);
BEGIN
INT item^number;
INT price;
INT on^hand;
END;
END;
END;
]
2. This example shows a structure that holds a start-up message.
[#DEF startup_message STRUCT
BEGIN
INT msgcode;
STRUCT default;
BEGIN
SUBVOL default^name;
END;
STRUCT infile;
BEGIN
FNAME infile^name;
END;
STRUCT outfile;
BEGIN
FNAME outfile^name;
END;
CHAR param (0:529);
END;
]
3. This example shows storage for substructure occurrences that begin on byte
boundaries because the substructure not only follows a CHAR item (“x”) but also starts
with a CHAR item (“aa”).
[#DEF s STRUCT
BEGIN
CHAR x;
STRUCT sub (0:2);
BEGIN
CHAR aa;
INT b;
CHAR c;
END;
INT y;