pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
STRING first[0:3];
STRING last[0:3];
END;
STRUCT .record;
BEGIN
STRUCT name (name_def); ! Declare substructure
INT age;
END;
STRING .my_name (name_def) := @record.name; ! Structure pointer
! contains address
! of substructure
my_name ':=' ["Sue Law"];
Example 120 Declaring and Initializing a Local STRING Structure Pointer
BEGIN
INT array[0:7];
STRUCT a_struct (*);
BEGIN
INT var;
INT buffer1[0:3];
STRING buffer2[0:4];
END;
INT .struct_ptr (a_struct) := @array; ! Structure pointer
END; ! contains address of
! array
Declaring System Global Pointers
NOTE: Only procedures that operate in privileged mode can access system global data.
The system global pointer declaration associates an identifier with a memory location at which
you store the address of a variable located in the system global data area.
type
is any data type except UNSIGNED; specifies the data type of the value to which the pointer
points.
.SG
is an indirection symbol (see Table 14 (page 41)).
identifier
is the identifier of the pointer.
preset-address
is the address of a variable in the system global data area. The address is determined by you
or the system during system generation.
Example 121 System Global Pointer Declaration
INT .SG newname;
176 Pointers