From: mfeldman@seas.gwu.edu (Mike Feldman)
Subject: test program for enumeration_IO
Date: 8 May 90 00:43:20 GMT [thread overview]
Message-ID: <1847@sparko.gwu.edu> (raw)
WITH Text_IO;
PROCEDURE Colors IS
TYPE English_Colors IS
(white, black, red, purple, blue, green, yellow, orange);
TYPE French_Colors IS
(blanc, noir, rouge, pourpre, bleu, vert, jaune, orange);
PACKAGE English_Color_IO IS
NEW Text_IO.Enumeration_IO (Enum => English_Colors);
PACKAGE French_Color_IO IS
NEW Text_IO.Enumeration_IO (Enum => French_Colors);
Eng_Color : English_Colors;
Fr_Color : French_Colors;
Position : Natural;
BEGIN
Text_IO.Put (Item => "Please enter an English color >");
English_Color_IO.Get (Item => Eng_Color);
Position := English_Colors'Pos(Eng_Color);
Fr_Color := French_Colors'Val(Position);
Text_IO.Put (Item => "The French color is ");
-- the first line below will compile;
-- will the second line?
French_Color_IO.Put (Item => Fr_Color);
French_Color_IO.Put (Item => Fr_Color, Set => Lower_Case);
Text_IO.New_Line;
END Colors;
next reply other threads:[~1990-05-08 0:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-05-08 0:43 Mike Feldman [this message]
1990-05-08 16:46 ` test program for enumeration_IO stt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox