TAL Programmer's Guide
Accessing Structure Items
Using Structures
096254 Tandem Computers Incorporated 8–29
The following example shows how you can index a standard indirect structure:
STRUCT .std_struct[0:99]; !Standard indirect structure
BEGIN
INT var; !Simple variable
STRING array[0:25]; !Array
STRUCT substr[0:9]; !Substructure
BEGIN
STRING array[0:25]; !Array
END;
END;
INT index := 5; !Simple variable
PROC x MAIN; !Declare procedure X
BEGIN
std_struct[index].var := 35;
!Access STD_STRUCT[5].VAR
std_struct[index+2].array[0] := "A";
!Access STD_STRUCT[7].ARRAY[0]
std_struct[index+2].array[25] := "Z";
!Access STD_STRUCT[7].ARRAY[25]
std_struct[9*index].substr[index-1].array[index-5] := "a";
!Access
! STD_STRUCT[45].SUBSTR[4].ARRAY[0]
END; !End procedure X