comp.lang.ada
 help / color / mirror / Atom feed
From: do_while@ridgecrest.ca.us (Do-While Jones)
Subject: Re: Trouble w/ End_Error exception in Integer_Text_IO
Date: 1997/06/20
Date: 1997-06-20T00:00:00+00:00	[thread overview]
Message-ID: <5oeplo$ac3$1@owens.ridgecrest.ca.us> (raw)
In-Reply-To: 01bc7c33$c23a2ca0$LocalHost@xhv46.dial.pipex.com


In article <01bc7c33$c23a2ca0$LocalHost@xhv46.dial.pipex.com>,
Nick Roberts <Nick.Roberts@dial.pipex.com> wrote:
>
>
>Ha Ha X <kql6708@is.nyu.edu> wrote in article
><33a4a1c5.2804336@netnews.worldnet.att.net>...
>> 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.
>[...]
>

This brings back memories of the Seventh National Ada Conference, 14-16
March, 1989.  What I said then, when I presented the paper "How to Live
With TEXT_IO", is still true today. 

The basic problem is that people aren't files.  Files never make a mistake
and then try to fix it by pressing the rubout key.  Files don't want to
move the cursor.  Files don't want to "press any key to continue."  Files
don't enter a real number when the program is expecting an integer as
often as people do.  TEXT_IO is a good file interface that can be used as
a simple user interface.

If you are writing a serious program that involves significant user input,
you should not be using TEXT_IO, or any of its 1995 variants. 

Ten years ago I wrote several user interfaces (VIRTUAL_TERMINAL,
SCROLL_TERMINAL, and FORM_TERMINAL) which are described in Ada in Action
(which you can download from the Ada Home Page).  Now that I do lots of
real-time interactive 2-D graphic programming (built entirely in Ada on
top of primitive bit-mapped graphics), I use a KEYBOARD package, a TEXT
window package, and DIALOG_BOX, MENU, CHECKLIST, etc. for user IO.  I use
TEXT_IO for reading and writing configuration files only.

TEXT_IO is an adequate user interface for throw-away programs.  I use it
for some of my module test routines.  But I never use it for programs that
customers will use.

TEXT_IO is certainly appropriate for beginner programs in a first-semester
programming course.  Just accept it for what it is--a simple, universal
user interface without much capability.  Use Get_Line to read entire lines
and process them yourself.

If you are doing any serious programming that involves a user interface,
use the AONIX GUI-builder tool, or CLAW, or some sort of windows/motif
interface, or write your own user-interface that does exactly what you
want, just like I did.  Don't try to make a silk purse out of TEXT_IO. 

Do-While Jones

            +--------------------------------+
            |    Know                 Ada    |
            |        [Ada's Portrait]        |
            |    Will              Travel    |
            | wire do_while@ridgecrest.ca.us |
            +--------------------------------+

                                       





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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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