Routines As Parameters - Sun Microsystems SunSoft Pascal 4.0 User Manual

Hewlett-packard user guide printer printer
Table of Contents

Advertisement

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

Routines as Parameters

The FORTRAN subroutine,
PassProc.f
202
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).
If the passed procedure is a top-level procedure, write it as follows:
subroutine PassProc ( r, s, prcdr )
real r, s
external prcdr
call prcdr ( r, s )
return
end
Pascal 4.0 User's Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SunSoft Pascal 4.0 and is the answer not in the manual?

Questions and answers

Table of Contents