* test program for enumeration_IO
@ 1990-05-08 0:43 Mike Feldman
1990-05-08 16:46 ` stt
0 siblings, 1 reply; 2+ messages in thread
From: Mike Feldman @ 1990-05-08 0:43 UTC (permalink / 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: test program for enumeration_IO
1990-05-08 0:43 test program for enumeration_IO Mike Feldman
@ 1990-05-08 16:46 ` stt
0 siblings, 0 replies; 2+ messages in thread
From: stt @ 1990-05-08 16:46 UTC (permalink / raw)
Re: Use of "SET=>LOWER_CASE" in Enumeration_IO.
LOWER_CASE is an enumeral from the type TEXT_IO.TYPE_SET.
This means that the enumeral is declared "within" TEXT_IO,
and you must either "use" TEXT_IO, or specify the
value for the "SET" parameter as "TEXT_IO.LOWER_CASE.
I.e., this should work:
French_Color_IO.Put(Item => Fr_Color, Set => Text_IO.Lower_Case);
S. Tucker Taft
Intermetrics, Inc.
Cambridge, MA 02138
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1990-05-08 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-05-08 0:43 test program for enumeration_IO Mike Feldman
1990-05-08 16:46 ` stt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox