TACL Reference Manual
Variables
HP NonStop TACL Reference Manual—429513-018
4-24
Redefining a Structure
•
The new item must be capable of the same alignment as the previous item.
Examples
Examples of redefinition declarations follow.
1. This example redefines part of an INT array as an INT2 array. The redefinition
begins at a(0):
[#DEF s STRUCT
BEGIN
INT a(-2:3);
INT2 b(1:2) REDEFINES a;
END;
]
2. This example shows a substructure redefinition; the new substructure is smaller
than the previous substructure:
[#DEF str1 STRUCT
BEGIN
STRUCT sub1;
BEGIN
INT int1;
END;
STRUCT sub2 REDEFINES sub1;
BEGIN
CHAR chr1;
END;
END;
]
Caution. Data stored by one definition might not be readable when retrieved by using another
definition. TACL does not ensure that the data being retrieved is valid under the definition by
which it is being retrieved.
Definition Redefinition
a(-2)
a(-1)
a(0)
b(1)
a(1)
a(2) b(2)
a(3)
Definition Redefinition
int1 chr1