home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
pascal
/
pascsrc.arc
/
SMALLREC.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
841b
|
31 lines
(* Chapter 9 - Program 1 *)
program A_Small_Record;
type Description = record
Year : integer;
Model : string[20];
Engine : string[8];
end;
var Cars : array[1..10] of Description;
Index : integer;
begin (* main program *)
for Index := 1 to 10 do begin
Cars[Index].Year := 1930 + Index;
Cars[Index].Model := 'Duesenburg';
Cars[Index].Engine := 'V8';
end;
Cars[2].Model := 'Stanley Steamer';
Cars[2].Engine := 'Coal';
Cars[7].Engine := 'V12';
Cars[9].Model := 'Ford';
Cars[9].Engine := 'rusted';
for Index := 1 to 10 do begin
Write('My ',Cars[Index].Year:4,' ');
Write(Cars[Index].Model,' has a ');
Writeln(Cars[Index].Engine,' engine.');
end;
end. (* of main program *)