From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,32c37aca7f5cedbb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-15 19:12:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!csulb.edu!newshub.sdsu.edu!west.cox.net!cox.net!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!59ce1190!not-for-mail Message-ID: <3D0BF45C.D12DE2BF@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: enumeration_io: get error References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 16 Jun 2002 02:12:43 GMT NNTP-Posting-Host: 63.184.0.223 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1024193563 63.184.0.223 (Sat, 15 Jun 2002 19:12:43 PDT) NNTP-Posting-Date: Sat, 15 Jun 2002 19:12:43 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:26058 Date: 2002-06-16T02:12:43+00:00 List-Id: The quick answer is not to use an instantiation of Enumeration_IO to do the input. Use Get_Line to obtain a String, then use 'Value or the version of Get that takes the value from a String to convert the String to a value of the enumeration type. Use a loop to handle the exception that occurs if the String does not contain the representation of an enumeration value. The long answer is to carefully review the semantics of Enumeration_IO.Get. Pay special attention to the cases in which the next character in the input is consumed and those in which the next character is looked at but not consumed. You will find that characters such as '*' are looked at but not consumed, meaning the next call to Get sees the same character. In this particular example, this causes infinite recursion. It is left as an exercise for the reader to figure out how to deal with this. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail