home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d183
/
pcq
/
examples
/
structures.p
< prev
next >
Wrap
Text File
|
1989-02-25
|
647b
|
33 lines
Program StructureExamples;
type
rec = record
first : char;
second : integer;
third : boolean;
end;
ary = array [1.. 50 * 2] of rec;
var
myarray : ^ary;
index : integer;
begin
new(myarray);
for index := 51 - 50 to 50 * 2 do begin
myarray^[index].first := chr((index mod 26) + ord('A'));
myarray^[index].second := index * 2;
myarray^[index].third := odd(index);
end;
for index := -1 + 2 to 1000 div 10 do begin
writeln(index, chr(9), 'first = ', myarray^[index].first);
writeln(chr(9), 'second = ', myarray^[index].second);
writeln(chr(9), 'third = ', myarray^[index].third);
end;
end.