188
Pascal 4.0 User’s Guide
8
The FORTRAN subroutine,
StrVar.f
subroutine StrVar ( s10, s80, vls )
character s10*10, s80*80
structure /VarLenStr/
integer nbytes
character a*25
end structure
record /VarLenStr/ vls
character ax*10, sx*80, vx*5
data ax / "abcdefghij" /,
& sx / "abcdefghijklmnopqrstuvwxyz" /,
& vx / "oyvay" /
s10(1:10) = ax(1:10)
s80(1:80) = sx(1:80)
vls.a(1:5) = vx(1:5)
vls.nbytes = 5
return
end
The Pascal main program,
StrVarmain.p
program StrVarmain(output);
type
varstr = varying [25] of char;
var
a: alfa;
s: string;
v: varstr;
procedure strvar(var xa: alfa; var xs: string;
var xv: varstr); external fortran;
begin
strvar(a, s, v);
writeln(a);
writeln(s);
writeln(v);
writeln('length(v)= ', length(v): 2)
end. { StrVarmain }
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: ......