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,8dd8ee71ca4e5206 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-03 12:57:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Newbie question on Ada TExt_IO Date: Thu, 3 Oct 2002 15:55:08 -0400 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <93d4dcd4.0210031020.b0cca2b@posting.google.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:29503 Date: 2002-10-03T15:55:08-04:00 List-Id: "Preben Randhol" wrote in message news:slrnapp7f6.45u.randhol+news@kiuk0156.chembio.ntnu.no... > > No I would have used exceptions here. I find it difficult to see how you > can avoid it. The issue is that if there's an error, the bad input doesn't get consumed. You have to remember to call Skip_Line, so you might as well call Get_Line instead. The other benefit is that you can interpret the input as meta-symbols. For example, I often interrogate the input as a string first: "quit" "q" "exit" "x" "first" "last" and if none of these test true, then I go ahead an interpret it as an integer input.