170
Pascal 4.0 User’s 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
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......