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,b30e93507fcd6ed9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-01 07:14:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!news.litech.org!lnsnews.lns.cornell.edu!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!server3.netnews.ja.net!server4.netnews.ja.net!server2.netnews.ja.net!newshost.central.susx.ac.uk!news.bton.ac.uk!not-for-mail From: John English Newsgroups: comp.lang.ada Subject: Re: Ada'83 to Ada'95 Problem Date: Thu, 01 Mar 2001 14:27:37 +0000 Organization: University of Brighton Message-ID: <3A9E5C59.1EF8A793@bton.ac.uk> References: <3A9E35F3.EE64F602@port.ac.uk> NNTP-Posting-Host: straumli.it.bton.ac.uk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: saturn.bton.ac.uk 983456848 27339 193.62.183.204 (1 Mar 2001 14:27:28 GMT) X-Complaints-To: news@bton.ac.uk NNTP-Posting-Date: 1 Mar 2001 14:27:28 GMT X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:5354 Date: 2001-03-01T14:27:28+00:00 List-Id: dis00109 wrote: > > I am trying to get a program to accept two integers as input by the user > (for a university project) however in the exception handling section of > my program it will not accept a float input as an error it merely > ignores everything after the decimal point. This would appear to be a > new feature in Ada'95, can anyone think of a way to solve this...PLEASE! ??? If you do this: Get(A); Get(B); and you enter 3.14, you'll get a Data_Error at the point where "." is read (the point where the point is read? ;-) The first Get will read an integer (3) and then stop at the first non-integer character ("."); the second Get will start at "." and go "ugh! that's not an integer" and bail out with a Data_Error without reading anything. If on the other hand you do this: Get(A); Skip_Line; Get(B); Skip_Line; you'll get exactly the effect you've described; the first Get reads an integer, and stops at the first non-integer character ("."), and Skip_Line then throws the rest of that line away (".14" in this case). The second Get will then read whatever is on the next line in the same way. Is this what you've done, perhaps? ----------------------------------------------------------------- John English | mailto:je@brighton.ac.uk Senior Lecturer | http://www.it.bton.ac.uk/staff/je Dept. of Computing | ** NON-PROFIT CD FOR CS STUDENTS ** University of Brighton | -- see http://burks.bton.ac.uk -----------------------------------------------------------------