Routines as parameters, Type shortreal – HP SunSoft Pascal 4.0 User Manual

Page 226

Advertising
background image

202

Pascal 4.0 User’s Guide

8

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 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

The FORTRAN subroutine,

PassProc.f

subroutine PassProc ( r, s, prcdr )

real r, s

external prcdr

call prcdr ( r, s )

return

end

Advertising