Technical data
46
Chapter 3: Fortran Program Interfaces
Fortran/Pascal Interface
This section discusses items you should consider when writing a call
between Fortran and Pascal.
Procedure and Function Declarations
This section explains procedure and function declaration considerations.
Names
In calling a Fortran program from Pascal, you must place an underscore (_)
as a suffix to routine names and data names.
To call Fortran from Pascal or vice versa, specify an underscore (_) as the
suffix of the name of the Fortran or Pascal routine being called. For example,
if the routine is called matrix, then call it by the name matrix_.
In Pascal, always declare the external Fortran subprogram or function with
VA R parameters.
Note that only one main routine is allowed per program. The main routine
can be written either in Pascal or Fortran. Table 3-4 contains an example of a
Pascal and a Fortran main routine.
Table 3-4 Main Routines
Pascal Fortran
program p; write (6,10)
begin 10 format ('hi!')
writeln ('hi!'); stop
end. end










