HP Pascal/iX Programmer's Guide (31502-90023)

7- 15
.
END;
FUNCTION func (PROCEDURE pvar (x : integer)) : real;
BEGIN
.
.
END;
PROCEDURE p1 (a : integer; VAR b : char); EXTERNAL;
PROCEDURE p2 (a : integer; VAR b : real); EXTERNAL;
PROCEDURE p3 (VAR a : integer; b : char); EXTERNAL;
PROCEDURE p4 (a,b : integer); EXTERNAL;
PROCEDURE p5 (a : integer); EXTERNAL;
BEGIN
proc(p1);
proc(p2); {illegal}
proc(p3); {illegal}
proc(p4); {illegal}
proc(p5); {illegal}
r := func(p5);
r := func(p4); {illegal}
r := func(p3); {illegal}
r := func(p2); {illegal}
r := func(p1); {illegal}
END.
The procedure proc has a procedure parameter, procvar. The parameter
list of procvar is congruent with the parameter list of the procedure p1,
but not with those of p2, p3, p4, or p5. Therefore, p1 can be an actual
parameter for procvar, but p2, p3, p4, and p5 cannot.
The function func has a procedure parameter, pvar. The parameter list of
pvar is congruent with the parameter list of the procedure p5, but not
with those of p1, p2, p3, or p4. Therefore, p5 can be an actual
parameter for pvar, but p1, p2, p3, and p4 cannot.
Example 2
This program uses function parameters whose own parameter lists do not
include conformant array parameters, procedure parameters, or other
function parameters.
PROGRAM prog;
VAR
r : real;
PROCEDURE proc (FUNCTION funcvar : (a,b,c : char) : Boolean);
BEGIN
.
.
.
END;
FUNCTION func (FUNCTION fvar : (a,b,c : char) : real) : real;
BEGIN
.
.
.
END;
FUNCTION f1 (x,y,z : char) : Boolean; EXTERNAL;
FUNCTION f2 (x,y,z : char) : real; EXTERNAL;
BEGIN