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 }
Содержание 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: ......