pTAL Guidelines for TAL Programmers
Differences Between TAL and pTAL
pTAL Guidelines for TAL Programmers—527256-002
3-13
Using Procedure Pointer Variables
Using Procedure Pointer Variables
Assign values to a procedure pointer using an assignment statement. The left side of
the assignment consists of an @ operator applied to the identifier of a procedure
pointer. The right side is an expression that evaluates to a PROCADDR.
You can assign the following items to a procedure pointer:
•
The address of a procedure or function:
PROC p;
BEGIN
END;
PROCPTR p1;
END PROCPTR;
@p1 := @p;
•
The value of another procedure pointer which you specify by applying an
@ operator to the name of the procedure pointer:
PROCPTR p1;
END PROCPTR;
PROCPTR p2;
END PROCPTR;
@p2 := @p1;
•
The value of a variable whose data type is PROCADDR for which you give the
name of the PROCADDR variable:
PROCADDR pa;
PROCPTR p1;
END PROCPTR;
@p1 := pa;
If the left side of an assignment statement is the address of a procedure pointer and
the right side is the address of a procedure or a procedure pointer:
•
The procedure attributes of the left and right sides must be the same, although
they need not appear in the same order.
•
The data types of the parameters must match, although the identifiers can differ.
If either side of an assignment statement is a procedure address (PROCADDR),
neither the procedure attributes nor the parameter types need match.