HP SunSoft Pascal 4.0 Instrukcja Użytkownika Strona 218

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 333
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 217
194 Pascal 4.0 Users 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 }
Przeglądanie stron 217
1 2 ... 213 214 215 216 217 218 219 220 221 222 223 ... 332 333

Komentarze do niniejszej Instrukcji

Brak uwag