comp.lang.ada
 help / color / mirror / Atom feed
From: sbredemeyer@westpac.com.au
Subject: Get (integer) help
Date: 1997/05/21
Date: 1997-05-21T00:00:00+00:00	[thread overview]
Message-ID: <864270399.21858@dejanews.com> (raw)


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.

Thankyou

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet




             reply	other threads:[~1997-05-21  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-21  0:00 sbredemeyer [this message]
1997-05-22  0:00 ` Get (integer) help Nick Roberts
1997-05-22  0:00 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox