Technical data
48
Chapter 3: Fortran Program Interfaces
The following Fortran statement
character*15 function g (…)
is equivalent to the Pascal code
type string = array [1..15];
var
length: integer;
a: array[1..15] of char;
procedure g_(var a:string;length:integer;…); external;
and could be invoked by the Pascal line
g_ (a, 15);
Arguments
The following rules apply to argument specifications in both Fortran and
Pascal programs:
• All arguments must be passed by reference. That is, the argument must
specify an address rather than a value. Thus, to pass constants or
expressions, their values must first be stored into variables and then the
addresses of the variables passed.
• When passing the address of a variable, the data representations of the
variable in the calling and called routines must correspond, as shown in
Table 3-6.
Table 3-6 Equivalent Fortran and Pascal Data Types
Pascal Fortran
integer integer*4, integer, logical
cardinal, char, boolean, character
enumeration
real real
double double precision
procedure subroutine










