TAL Programmer's Guide

Using Structure Pointers
Using Pointers
9–18 096254 Tandem Computers Incorporated
Accessing Data With
Structure Pointers
You access the data item to which a pointer points by using the pointer identifier,
without @, in statements.
In a move, SCAN, or RSCAN statement, you normally use the unqualified identifier of
a structure pointer. (An extended pointer cannot be the object of a SCAN or RSCAN
statement.)
Assigning Values to Structure Items
In an assignment statement, you can specify the qualified identifier of a structure item
suffixed to a standard or extended structure pointer. The following example shows
the qualified identifier of structure item NAME, which is declared in substructure
CUSTOMER, which is declared in substructure RECORDS, which is declared in a
structure that is pointed to by STRUCT_PTR:
struct_ptr.records.customer.name
The following example assigns values to items in a structure, pointed to by
STRUCT_PTR.INT2 and STRUCT_PTR.STR1:
STRUCT .astruct[0:2]; !Declare ASTRUCT
BEGIN
INT int1;
INT int2;
INT int3;
STRING str1;
END;
INT struct_ptr (astruct) := @astruct[0];
!Declare STRUCT_PTR; initialize
! it with address of ASTRUCT[0]
struct_ptr.int2 := %14; !Assign values to ASTRUCT[0]
struct_ptr.str1 := %3; ! items INT2 and STR1