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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.200.41.168 with SMTP id 37mr18173600qts.26.1471904318393; Mon, 22 Aug 2016 15:18:38 -0700 (PDT) X-Received: by 10.157.51.45 with SMTP id f42mr1271206otc.12.1471904318350; Mon, 22 Aug 2016 15:18:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!j37no10054966qta.0!news-out.google.com!d68ni35925ith.0!nntp.google.com!f6no12144957ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 22 Aug 2016 15:18:38 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8302:3f70:3d52:1ee3:81e8:b6ec; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8302:3f70:3d52:1ee3:81e8:b6ec References: <07632b3f-f419-4865-a8f8-01b568a6883e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2d96f593-e1d3-43da-9a6a-16e8ce0f675b@googlegroups.com> Subject: Re: Why does this input get "skipped"? From: rieachus@comcast.net Injection-Date: Mon, 22 Aug 2016 22:18:38 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2482 X-Received-Body-CRC: 2321304836 Xref: news.eternal-september.org comp.lang.ada:31505 Date: 2016-08-22T15:18:38-07:00 List-Id: On Saturday, August 20, 2016 at 8:36:53 PM UTC-4, John Smith wrote:=20 > Adding a Get_Line right after the Integer_Text_IO.Get did get me the resu= lt that I want. However, why does this feel like a kludge? Because Text_IO was developed thirty years ago to deal with systems that do= n't exist today? BTW, always reading a line (Get_Line) at a time into a buffer, and then rea= ding from the line with a fairly complex scanner is the way almost all Ada = compilers written in Ada work. Why? It allows you to do more sophisticate= d error recognition/correction than just throwing away the bad input. Get_Line, Skip_Line, and Set_Col(1) should all get you to the same place. (= Except for some sequences involving End_Of_Page marks.) But Get_Line into a= buffer allows you to at a minimum tell the user what he did wrong: 'Pinc' is not a recognized color. ...is an error message that shouldn't raise the user's blood pressure. = Of course, he or she might rage at "'Puce' is not a recognized color," but = at least he or she will be reacting to your taste in colors, not potential = input issues. ;-) =20