![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395227x1.png)
8
The Pascal main program,
PassProcmain.p
The commands to compile and execute PassProc.f and PassProcmain.p
program PassProcmain;
var
a, b: real;
procedure passproc(var u: real; var v: real; procedure p(var r: real; var s: real)); external fortran;
procedure AddOne(var x: real; var y: real);
begin
y := x + 1 end; { AddOne }
begin
a := 8.0; b := 0.0;
passproc(a, b, AddOne); writeln(a: 4: 1, b: 4: 1)
end. { PassProcmain }
hostname% f77
passproc
hostname% pc PassProc.o PassProcmain.p
8.0 9.0
If the procedure is not a
When an outer block procedure or function is passed as an argument, Pascal passes a null pointer in the position normally occupied by the static link of the passed routine. So that procedures and functions can be passed to other languages as arguments, the static links for all procedure or function arguments are placed after the end of the conformant array bounds pairs, if any.
The | 203 |