HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 221

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 220
The FORTRAN–Pascal Interface 197
8
Value Parameters
With external fortran on the procedure statement, Pascal passes value
parameters as FORTRAN expects them.
The Pascal main program,
VarRecmain.p
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 }
The commands to compile and
execute VarRec.f and
VarRecmain.p without –xl
hostname% f77 -c VarRec.f
VarRec.f:
varrec:
hostname% pc VarRec.o VarRecmain.p -lpfc -lF77
hostname% a.out
b
Przeglądanie stron 220
1 2 ... 216 217 218 219 220 221 222 223 224 225 226 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag