The FORTRAN–Pascal Interface
169
8
See the following example:
The Pascal procedure,
SimVar.p
procedure simvar_(var t, f: boolean; var c: char;
var i: integer; var r: real;
var si: integer16; var sr: shortreal);
begin
t := true;
f := false;
c := 'z';
i := 9;
r := 9.9;
si := 9;
sr := 9.9
end; { simvar_ }
The FORTRAN main program,
SimVarmain.f
logical*1 t, f
character c
integer*4 i
double precision d
integer*2 si
real sr
call SimVar ( t, f, c, i, d, si, sr )
write(*, "(L2,L2,A2,I2,F4.1,I2,F4.1)")
& t, f, c, i, d, si,sr
stop
end
The commands to compile and
execute
SimVar.p
and
SimVarmain.f
hostname% pc -c SimVar.p
hostname% f77 SimVar.o SimVarmain.f -lpfc -lpc
SimVarmain.f:
MAIN:
hostname% a.out
T F z 9 9.9 9 9.9
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......