![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395209x1.png)
8
Simple Types
The simple types pass in a straightforward way, as follows:
The Pascal function,
RetReal.p
The FORTRAN main program, RetRealmain.f
function retreal_(var x: real): real;
begin
retreal_ := x + 1 end; { retreal_ }
double precision r, s, RetReal r = 2.0
s = RetReal( r )
write( *, "(2f4.1)") r, s stop
end
The commands to compile and execute RetReal.p and RetRealmain.f without
hostname% pc
hostname% f77 RetReal.o RetRealmain.f
MAIN: hostname% a.out 2.0 3.0
Type shortreal
There is no problem with returning a shortreal function value between Pascal and FORTRAN. As in the previous example, it can be passed exactly, with the Pascal shortreal type matching the FORTRAN real type (without
Procedure Calls: Pascal-FORTRAN
This section parallels “Procedure Calls:
The | 185 |