The Pascal main program,
VarRecmain.p
The commands to compile and
execute VarRec.f and
VarRecmain.p without –xl
Value Parameters
program VarRecmain;
type
vr =
record
case tag: char of
'a': ( ch1, ch2: char );
'b': ( flag: boolean );
'K': ( ALIGN: integer )
end;
var
Rec: vr;
procedure varrec(var d: vr); external fortran;
begin
Rec.tag := 'a';
Rec.ch1 := 'a';
Rec.ch2 := 'b';
varrec(Rec);
writeln(Rec.ch2)
end. { VarRecmain }
hostname% f77 -c VarRec.f
VarRec.f:
varrec:
hostname% pc VarRec.o VarRecmain.p -lpfc -lF77
hostname% a.out
b
With external fortran on the procedure statement, Pascal passes value
parameters as FORTRAN expects them.
The FORTRAN–Pascal Interface
8
197
Need help?
Do you have a question about the SunSoft Pascal 4.0 and is the answer not in the manual?
Questions and answers