comp.lang.ada
 help / color / mirror / Atom feed
From: kql6708@is.nyu.edu (Ha Ha X)
Subject: Trouble w/ End_Error exception in Integer_Text_IO
Date: 1997/06/16
Date: 1997-06-16T00:00:00+00:00	[thread overview]
Message-ID: <33a4a1c5.2804336@netnews.worldnet.att.net> (raw)


I've been having a lot of trouble with an irritating feature of
Ada.Integer_Text_IO's End_Error exception. When using the Get()
procedure, if the user enters a manual EOF from the keyboard (^D in
Unix, or ^Z in DOS), Get() raises End_Error. This is, I suppose,
intended to prevent people from reading past EOF in a text file. Fine.

However, when I am getting input from user with Integer_Text_IO, I
want to just clear that EOF off the input stream, put an error
message, and loop back for new input.  Unfortunately, End_Error does
not clear EOF off the stream. Furthermore, Skip_Line's defined
behavior is to raise End_Error if you attempt to skip EOF.

The net result is that when a user hits ^Z by accident, I am forced to
bomb out of the program with an exception. I've searched in the AARM
for a solution, to no avail. This problem extends to virtually every
input procedure in Ada.Text_IO.

So, in short, my question is: how can EOF be cleared off the standard
input stream? I'm using GNAT 3.05 for MS-DOS, if that's any help.

Thanks in advance.

~k.lee
kql6708@is.nyu.edu






             reply	other threads:[~1997-06-16  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-16  0:00 Ha Ha X [this message]
1997-06-16  0:00 ` Trouble w/ End_Error exception in Integer_Text_IO john schneider
1997-06-18  0:00 ` Nick Roberts
1997-06-20  0:00   ` Do-While Jones
1997-06-21  0:00   ` Robert Dewar
replies disabled

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