comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+news@pvv.org>
Subject: Re: Newbie question on Ada TExt_IO
Date: Thu, 3 Oct 2002 20:07:22 +0000 (UTC)
Date: 2002-10-03T20:07:22+00:00	[thread overview]
Message-ID: <slrnapp8rr.45u.randhol+news@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: upp84t5nh0425a@corp.supernews.com

On Thu, 3 Oct 2002 15:55:08 -0400, Matthew Heaney wrote:
> 
> "Preben Randhol" <randhol+news@pvv.org> wrote in message
> news:slrnapp7f6.45u.randhol+news@kiuk0156.chembio.ntnu.no...
>>
>> No I would have used exceptions here. I find it difficult to see how you
>> can avoid it.
> 
> The issue is that if there's an error, the bad input doesn't get consumed.
> You have to remember to call Skip_Line, so you might as well call Get_Line
> instead.

I don't understand, I did use Get_Line in my code. I can see a couple of
problems though. I defined the String from only 1 to 80 so if you input
a string above 80 characters it will be split. I also should have
checked if the Last > 1 because one could give 1000 and the program
would accept it as 1, but I left this for the reader :-)

I wasn't refering to Get I was saying that I would use exceptions and I
have a bit problems with seeing a solution where you do not have any
exception handling when you expect user input.

Or in other words if you are dealing with a human then expect exceptions
;-)

-- 
Ada95 is good for you.
http://libre.act-europe.fr/Software_Matters/02-C_pitfalls.pdf



  reply	other threads:[~2002-10-03 20:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 18:20 Newbie question on Ada TExt_IO Justin
2002-10-03 18:50 ` Matthew Heaney
2002-10-03 19:05 ` Jeffrey Carter
2002-10-03 19:35 ` David C. Hoos
2002-10-03 19:35 ` tmoran
2002-10-03 19:43 ` Preben Randhol
2002-10-03 19:55   ` Matthew Heaney
2002-10-03 20:07     ` Preben Randhol [this message]
2002-10-04  2:42 ` SteveD
2002-10-04 17:49   ` Justin Birtwell
2002-10-04 18:00     ` David C. Hoos
2002-10-04 18:04       ` Preben Randhol
2002-10-04 18:00     ` Preben Randhol
2002-10-04 18:02       ` Preben Randhol
2002-10-04 18:34     ` tmoran
2002-10-04 17:34 ` Justin Birtwell
2002-10-04 17:58   ` Preben Randhol
2002-10-04 18:13   ` tmoran
2002-10-04 20:07   ` Jeffrey Carter
2002-10-07  8:26     ` Fraser Wilson
2002-10-07 19:44       ` Jeffrey Carter
2002-10-05  2:43   ` SteveD
2002-10-05  5:25     ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2002-10-07  6:01 Grein, Christoph
2002-10-07  8:27 Grein, Christoph
2002-10-07 11:48 ` Fraser Wilson
2002-10-07 12:46   ` Robert A Duff
replies disabled

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