HP SunSoft Pascal 4.0 Bedienungsanleitung Seite 194

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 333
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 193
170 Pascal 4.0 Users Guide
8
Simple Types with the –xl Option
When you pass the -xl option, the Pascal data type real must be paired with
a FORTRAN data type real; the Pascal data type integer must be paired
with a FORTRAN data type, integer*2.
Strings of Characters
The FORTRAN counterpart to the Pascal alfa and string types is a
character string, and the FORTRAN counterpart to the Pascal varying is a
structure. By default, FORTRAN, passes all by reference:
The Pascal procedure,
StrVar.p
type
varstr = varying [25] of char;
procedure strvar_(var a: alfa; var s: string;
var v: varstr);
begin
a := 'abcdefghij';
s := 'abcdefghijklmnopqrtstuvwxyz';
v := 'oyvay'
end; { strvar_ }
The FORTRAN main program,
StrVarmain.f
structure /VarLenStr/
integer nbytes
character a*25
end structure
record /VarLenStr/ vls
character s10*10, s80*80, s25*25
vls.nbytes = 0
Call StrVar( s10, s80, vls )
s25(1:5) = vls.a(1:vls.nbytes)
write (*, 1) s10, s80, s25
1 format("s10='", A, "'",
& / "s80='", A, "'",
& / "s25='", A, "'" )
end
Seitenansicht 193
1 2 ... 189 190 191 192 193 194 195 196 197 198 199 ... 332 333

Kommentare zu diesen Handbüchern

Keine Kommentare