![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395225x1.png)
8
The commands to compile and execute PassPtr.f and PassPtrmain.p
hostname% f77
PassPtr.f:
passptr:
hostname% pc PassPtr.o PassPtrmain.p
hostname% a.out 9 9.9
Function Return Values
The FORTRAN function, RetReal.f
The Pascal main program, RetRealmain.p
Function return values match types the same as with parameters, and they pass in much the same way.
Simple Types
The simple types pass in a straightforward way, as in this example:
double precision function retreal ( x ) retreal = x + 1.0
return end
program retrealmain;
var
r, s: real;
function retreal(x: real): real; external fortran;
begin
r := 2.0;
s := retreal(r); writeln(r: 4: 1, s: 4: 1)
end. { retrealmain }
The | 201 |