![](/images/backgrounds/286549/hp-sunsoft-pascal-4-0-users-manual-549395194x1.png)
8
When you pass the
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
1format("s10='", A, "'",
&/ "s80='", A, "'",
&/ "s25='", A, "'" )
end
170 | Pascal 4.0 User’s Guide |