8

The commands to compile and execute RetReal.f and RetRealmain.p

hostname% f77 -c RetReal.f RetReal.f

retreal:

hostname% pc RetReal.o RetRealmain.p -lpfc -lF77 hostname% a.out

2.0 3.0

Type shortreal

You can return a shortreal function value between Pascal and FORTRAN. Pass it exactly as in the previous example, with the Pascal shortreal type matching the FORTRAN real type (without -xl).

Routines as Parameters

If the passed procedure is a top-level procedure, write it as follows:

The FORTRAN subroutine,

PassProc.f

subroutine PassProc ( r, s, prcdr ) real r, s

external prcdr call prcdr ( r, s ) return

end

202

Pascal 4.0 User’s Guide

Page 226
Image 226
HP SunSoft Pascal 4.0 manual Routines as Parameters, Commands to compile and execute RetReal.f and RetRealmain.p, 202