pTAL Conversion Guide

Procedures, Subprocedures, and Procedure
Pointers
pTAL Conversion Guide527302-002
16-11
Declaring PROCPTRs in Structures
You can equivalence a PROCPTR to any previously declared variable provided that
the width of the previous variable must be greater than or equal to the width of the
PROCPTR.
Declaring PROCPTRs in Structures
You can declare PROCPTR fields within structure declarations.
procptr
is a PROCPTR declaration as described earlier in this section.
Example 16-2. PROCPTRs as Variables and Formal Parameters
INT i;
INT .EXT j;
REAL k;
PROCADDR pa;
PROC p (i, j) EXTENSIBLE, CALLABLE;
INT i, .EXT j;
FORWARD;
PROCPTR a (i, j) EXTENSIBLE, CALLABLE; ! Initialize a to point
INT i, .EXT j; ! to procedure p
END PROCPTR := @p;
FIXED PROCPTR b (str : length); ! b has one parameter
STRING .str; ! pair
INT length;
END PROCPTR;
PROCPTR c (p); ! c has one parameter,
REAL PROCPTR p(x); ! p, which is a PROCPTR
REAL x;
END PROCPTR;
END PROCPTR;
REAL PROCPTR d (x); ! d has one parameter
REAL x;
END PROCPTR;
PROCPTR e(i); ! Equivalence e to d
INT i;
END PROCPTR = d;
;
VST715.vsd
=
procptr
prev-identifier