comp.lang.ada
 help / color / mirror / Atom feed
* Trouble w/ End_Error exception in Integer_Text_IO
@ 1997-06-16  0:00 Ha Ha X
  1997-06-16  0:00 ` john schneider
  1997-06-18  0:00 ` Nick Roberts
  0 siblings, 2 replies; 5+ messages in thread
From: Ha Ha X @ 1997-06-16  0:00 UTC (permalink / 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






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-06-21  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-16  0:00 Trouble w/ End_Error exception in Integer_Text_IO Ha Ha X
1997-06-16  0:00 ` john schneider
1997-06-18  0:00 ` Nick Roberts
1997-06-20  0:00   ` Do-While Jones
1997-06-21  0:00   ` Robert Dewar

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