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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4228cd5af810e7ab X-Google-Attributes: gid103376,public From: "Nick Roberts" Subject: Re: Get (integer) help Date: 1997/05/22 Message-ID: <01bc66f4$65f2de00$LocalHost@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 243166433 References: <864270399.21858@dejanews.com> Organization: UUNet PIPEX server (post doesn't reflect views of UUNet PIPEX) Newsgroups: comp.lang.ada Date: 1997-05-22T00:00:00+00:00 List-Id: sbredemeyer@westpac.com.au wrote in article <864270399.21858@dejanews.com>... { I am relatively new to Ada 95 and am having trouble with a GetInt library unit that I have created. It is a simple procedure with in parms of Min_Allow, Max_Allow and Prompt_Text that out's The_Integer. I have created user defined exceptions handlers for integer values outside the range of Min_Allow .. Max_Allow (The_Integer is unconstrained, no subtype declaration), and used Data_Error and Constraint_Error as well. The problem I am having is that my exception handler handles inputs such as Strings, > Integer'Last and integers out of range Min_Allow .. Max_Allow but spits the dummy if I input a real. I know what is happening (i.e. given 1.234, GetInt gets 1 as valid integer input with the marker pointing to "." which is then read in with the next execution of the procedure) but not how to get around it. I have been trying to find documentation on look_ahead which I think might solve my problem, but with no success. Can anybody help? Please let me know if I have submitted this to an inappropriate NewsGroup. This is my first visit to DejaNews. } 1. Please use a different way to post messages - your formatting came out yukky! 2. Tell us your first name please; we are (usually :-) on first name terms here. 3. Please give us a little bit more information about your problem. Why, specifically, are you programming your own integer input (rather than using the predefined library)? Just what behaviour do you require of it? Could you post the (relevant) code, please? Nick.