home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
pcmag
/
vol8n19.arc
/
ENUMLAST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-10-02
|
591b
|
34 lines
ENUMLAST.PAS
PROGRAM Enumerated;
(* Insert more items in the enumerated type "Fruit". The
program will still correctly display the ordinal values
of all the items.*)
TYPE
Fruit = (Apple, Orange, Grape, Pineapple);
FruitRay = array[Fruit] of byte;
CONST
FirstFruit = Fruit(0);
LastFruit = Fruit(sizeof(FruitRay)-1);
PROCEDURE ShowAllFruits;
VAR
F : Fruit;
BEGIN
WriteLn('Here are the ordinal values of all the fruits:');
For F := FirstFruit To LastFruit DO
Write( Ord(F):3 );
WriteLn;
END;
BEGIN
ShowAllFruits;
END.