comp.lang.ada
 help / color / mirror / Atom feed
From: "Singlespeeder" <singlespeeder@btinternet.com>
Subject: Re: Ada'83 to Ada'95 Problem
Date: Thu, 1 Mar 2001 19:29:46 -0000
Date: 2001-03-01T19:29:46+00:00	[thread overview]
Message-ID: <97m7m4$bvo$1@plutonium.btinternet.com> (raw)
In-Reply-To: 3A9E35F3.EE64F602@port.ac.uk


"dis00109" <dis00109@port.ac.uk> wrote in message
news:3A9E35F3.EE64F602@port.ac.uk...
> 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're using the Text_IO Get procedures make sure you're using Float_IO.

Be warned that on some compilers (in my experience DEC Ada 3.5-20) the
string really has to represent a float or it will raise an exception. GNAT
is more liberal in it's interpretation of the standard and will happily
return the integer part. You have to check the value of Last to see how much
of the string it converted.

Nick





  parent reply	other threads:[~2001-03-01 19:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-01 11:43 Ada'83 to Ada'95 Problem dis00109
2001-03-01 14:19 ` Marin David Condic
2001-03-01 14:27 ` John English
2001-03-01 18:23 ` Ted Dennison
2001-03-01 19:29 ` Singlespeeder [this message]
2001-03-02 16:03 ` Tucker Taft
  -- strict thread matches above, loose matches on Subject: below --
2001-03-01 17:39 Beard, Frank
2001-03-05 13:51 ` John English
replies disabled

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