comp.lang.ada
 help / color / mirror / Atom feed
From: evans@evans.pgh.pa.us (Arthur Evans Jr)
Subject: Re: Exception problem
Date: 1997/02/22
Date: 1997-02-22T00:00:00+00:00	[thread overview]
Message-ID: <evans-2202972108360001@ppp1.s8.pgh.net> (raw)
In-Reply-To: 330A0D25.313@fs2.assist.uci.edu


Larry Coon <larry@fs2.assist.uci.edu> wrote:

> This code handles non-positive numeric input (eg: 0 or -3) correctly.  
> But when I give it non-numeric input (eg: C), it displays the "Entry 
> must be a number.  Try again" message repeatedly and never stops for 
> input again.

When Get(X) notes that the first character ('C' in your case) cannot be
valid, it immediately raises the exception without reading anything from
the input stream.  So, the offending character is still there on the
next try.  Add a call to Skip_Line.

Art Evans

Arthur Evans Jr, PhD
Ada Consulting
evans@evans.pgh.pa.us




  parent reply	other threads:[~1997-02-22  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-18  0:00 Exception problem Larry Coon
1997-02-18  0:00 ` Michael Feldman
1997-02-19  0:00   ` Larry Coon
1997-02-19  0:00 ` Keith Allan Shillington
1997-02-19  0:00 ` David C. Hoos, Sr.
1997-02-19  0:00   ` Larry Coon
1997-02-19  0:00   ` Robert Dewar
1997-02-19  0:00 ` Joerg Rodemann
1997-02-19  0:00   ` Mats Weber
1997-02-22  0:00 ` Arthur Evans Jr [this message]
1997-02-24  0:00   ` Larry Coon
1997-02-24  0:00     ` Larry Kilgallen
1997-02-24  0:00       ` Larry Coon
1997-02-25  0:00         ` Fergus Henderson
1997-02-25  0:00     ` Do-While Jones
1997-03-09  0:00       ` John Volan
1997-03-09  0:00         ` Robert Dewar
1997-03-12  0:00         ` Keith Thompson
1997-02-25  0:00   ` Robert I. Eachus
replies disabled

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