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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8dd8ee71ca4e5206,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-03 11:20:25 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: jbirtwell@yahoo.com (Justin) Newsgroups: comp.lang.ada Subject: Newbie question on Ada TExt_IO Date: 3 Oct 2002 11:20:24 -0700 Organization: http://groups.google.com/ Message-ID: <93d4dcd4.0210031020.b0cca2b@posting.google.com> NNTP-Posting-Host: 151.202.46.147 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1033669224 4307 127.0.0.1 (3 Oct 2002 18:20:24 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Oct 2002 18:20:24 GMT Xref: archiver1.google.com comp.lang.ada:29496 Date: 2002-10-03T18:20:24+00:00 List-Id: Hi, I'm relatively new to Ada. I've read 1/2 of Programming in Ada95 by Barnes, done half of Lovelace and read as much as I can stomach of the Ada RM. Forgive me if this question is too basic, but I've been unable to see any reference to it in the previous documentation. I'm doing TextIO from the command prompt. But I'm having difficulty validating the input. For example I'm asking the user to enter a number, let's say I'm expecting an integer between 1 and 6 X:Integer; ... Put("Please enter a number between 1 and 6); Get(x); But what if they give me 'abc' or 4.44 or simply 1230000000000000000000000000000000000000000000000000000000000000000000000 How can I handle this? From my take on what I've read I should avoid exception handling for things I'm not expecting, so I've ruled out exceptions, that leaves me with obtaining a value of generic type and evalutating the type at run-time...how can I do this? Is this the right strategy? Thanks for they help, Justin