pTAL Reference Manual (H06.08+)
Pointers
HP pTAL Reference Manual—523746-006
10-15
Initializing Simple Pointers
You can apply the @ operator to these global variables:
Simple pointers receive their initial values when you compile the source code. Local or
sublocal simple pointers receive their initial values at each activation of the
encompassing procedure or subprocedure.
Variable @
identifier
?
Direct array Yes
Standard indirect array Yes
Extended indirect array No
Direct structure Yes
Standard indirect structure Yes
Extended indirect structure No
Simple pointer No
Structure pointer No
Example 10-9. Declaring But Not Initializing a Simple Pointer
INT(32) .ptr;
Example 10-10. Declaring and Initializing a Simple Pointer
STRING .bytes[0:3]; ! Indirect array
STRING .s_ptr := @bytes[3]; ! Simple pointer initialized with
! address of bytes[3]
Example 10-11. Declaring and Initializing a STRING Simple Pointer
INT .a[0:39]; ! INT array
STRING .ptr := @a[0] '<<' 1; ! STRING simple pointer
! initialized with byte address
! of a[0]
Example 10-12. Declaring and Initializing Simple Pointers
INT a[0:1] := [%100000, %110000]; ! Array
INT .int_ptr1 := a[0]; ! Simple pointer
! initialized with %100000
INT .int_ptr2 := a[1]; ! Simple pointer
! initialized with %110000










