pTAL Reference Manual (H06.08+)
Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual—523746-006
14-34
Assignments to PROCPTRs
Once you have set up a PROCPTR to point to a procedure, you can call the procedure
by using the PROCPTR name in a CALL statement or, if the PROCPTR is typed, in an
expression
:
CALL a(1, 2);
r := d(r);
IF (s1[i].f(r)) < 1.0E0 THEN ...
Example 14-18. Assignments to PROCPTRs
REAL r;
INT i;
STRUCT s1 [0:9];
BEGIN
REAL PROCPTR f(x);
REAL x;
END PROCPTR;
END;
PROC p (i, j) EXTENSIBLE, CALLABLE; ! Declare PROC p in a
INT i, .EXT j; ! FORWARD declaration
FORWARD;
PROCPTR a (i, j) EXTENSIBLE,CALLABLE; ! Declare PROCPTR a and
INT i, .EXT j; ! initialize it to
END PROCPTR; ! point to PROC p
PROCPTR c (p);
REAL PROCPTR p (x);
REAL x;
END PROCPTR;
END PROCPTR;
REAL PROCPTR d (x); ! Declare REAL PROCPTR d
REAL x; ! with REAL parametera
END PROCPTR;
@a := @p;
@d := @s1[2].f;
@s1[3].f := @d;
CALL c(d);










