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,f19c6c58ce93435 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-10 16:49:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: Subject: Re: Error checking for type incompatibility X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <3KcR7.27737$wL4.70194@rwcrnsc51> NNTP-Posting-Host: NCcR7-133114-wL4-70764@rwcrnsc51 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51 1008031743 NCcR7-133114-wL4-70764@rwcrnsc51 (Tue, 11 Dec 2001 00:49:03 GMT) NNTP-Posting-Date: Tue, 11 Dec 2001 00:49:03 GMT Organization: AT&T Broadband Date: Tue, 11 Dec 2001 00:49:03 GMT Xref: archiver1.google.com comp.lang.ada:17728 Date: 2001-12-11T00:49:03+00:00 List-Id: "Ben" wrote in message news:bf8dbe70.0112101628.1092b75a@posting.google.com... > Hi, > I am new to Ada. I decided I would try to learn a new language and Ada > seemed like a fun project. cool :-) > I got a few books, and one of them has > challenge problem where I am supposed to do some error checking on > input. This includes checking to make sure that the input type is > correct. More specifically: the program is supposed to accept only > integer values. So I need to be able to have an error handler that > will recognize if someone tries to enter a noninteger value and ask > them to re-enter a correct value. Since this is a "challenge problem" > they are not giving me alot to work on here. I checked another book, > and it had some examples on error handling, but not at the level I > need. And neither book had any example code that was helpful. > Remember, I'm new to Ada (from the C++ world) so packages are new to > me. What do I need folks. Your help is greatly appreciated. > > Thanks, > Ben Let me ask you this: how would you do this in C++? ( I don't mean that rhetorically; I can imagine different approaches to this, and I'm wondering which one seems right to you). What is your unit of input, e.g. do they enter a complete expression on a line, or just one token, or what? How are you doing your tokenization? -- mark