pTAL Reference Manual (H06.03+)

Equivalenced Variables
HP pTAL Reference Manual523746-005
11-15
Equivalencing PROCADDR Variables and
PROCPTR Variables
REFALIGNED Clause for Equivalenced Simple Pointers
The REFALIGNED clause assigns a REFALIGNED attribute (2 or 8) to a simple
equivalenced pointer when you declare the pointer. Equivalenced pointers do not
inherit the reference alignment of the previous variable.
Equivalencing PROCADDR Variables and
PROCPTR Variables
You can equivalence PROCPTR variables to PROCADDR and other PROCPTR, and
you can equivalence PROCADDR to PROCPTR and other PROCADDR.
Example 11-6. REFALIGNED Clause for Equivalenced Simple Pointers
?REFALIGNED(8) ! Default reference alignment is 8
INT .p REFALIGNED(2); ! Reference alignment of p is 2
INT .q REFALIGNED(8) = p; ! Reference alignment of q is 8
INT .r REFALIGNED(2) = p; ! Reference alignment of r is 2
INT .s = p; ! Reference alignment of s is 8
INT .t; ! Reference alignment of t is 8
Example 11-7. Equivalencing PROCADDR and PROCPTR Variables
PROCPTR a; ! a is a procedure pointer
END PROCPTR;
PROCADDR b; ! b is a procedure address
PROCADDR c = a; ! c is a procedure address equivalenced to a
! procedure pointer
PROCADDR d = b; ! d is a procedure address equivalenced to
! another procedure address
PROCPTR e; ! e is a procedure pointer equivalenced to
END PROCPTR = a; ! another procedure pointer
PROCPTR f; ! f is a procedure pointer equivalenced to a
END PROCPTR = b; ! procedure address