194
Pascal 4.0 User’s Guide
8
Records and Structures
Records and structures pass as follows:
The FORTRAN subroutine,
StruChr.f
subroutine StruChr ( vls )
structure /VarLenStr/
integer nbytes
character a*25
end structure
record /VarLenStr/ vls
vls.a(1:5) = 'oyvay'
vls.nbytes = 5
return
end
The Pascal main program,
StruChrmain.p
program StruChrmain;
type
lenstr =
record
nbytes: integer;
chrstr: array [0..25] of char
end;
var
v: lenstr;
procedure struchr(var v: lenstr);
external fortran;
begin
struchr(v);
writeln('v.chrstr = "', v.chrstr, '"');
writeln('v.nbytes =', v.nbytes: 2)
end. { StruChrmain }
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: ......