pTAL Guidelines for TAL Programmers
Differences Between TAL and pTAL
pTAL Guidelines for TAL Programmers—527256-002
3-15
Declaring Procedure Pointer Structure Fields
Example 3-7 on page 3-15 uses structure s1 from Example 3-6 on page 3-15.
Example 3-6. Procedure Pointers in Template Structure
STRUCT s1(*);
BEGIN
REAL PROCPTR f(x);
REAL x;
END PROCPTR;
REAL PROCPTR g(x);
INT x;
END PROCPTR = f;
REAL PROCPTR h(x);
FIXED x;
END PROCPTR = g;
END;
Example 3-7. Structure That Uses Template Structure From Example 3-6
LITERAL type_real, type_int, type_fixed;
STRUCT s2(s1);
REAL my_real;
INT my_index := type_int;
CASE my_index OF
BEGIN
type_real -> my_real := s.f(3.0E1);
type_int -> my_real := s.g(3);
type_fixed -> my_real := s.h(3F);
END;
Example 3-8. Valid and Invalid Structure Redefinitions (page 1 of 2)
STRUCT str;
BEGIN
PROCPTR a;
END PROCPTR;
PROCADDR b;