From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5544a67afca45ba2 X-Google-Attributes: gid103376,public From: do_while@ridgecrest.ca.us (Do-While Jones) Subject: Re: Trouble w/ End_Error exception in Integer_Text_IO Date: 1997/06/20 Message-ID: <5oeplo$ac3$1@owens.ridgecrest.ca.us>#1/1 X-Deja-AN: 251415862 References: <33a4a1c5.2804336@netnews.worldnet.att.net> <01bc7c33$c23a2ca0$LocalHost@xhv46.dial.pipex.com> Organization: RidgeNet - SLIP/PPP Internet, Ridgecrest, CA. (619) 371-3501 Newsgroups: comp.lang.ada Date: 1997-06-20T00:00:00+00:00 List-Id: In article <01bc7c33$c23a2ca0$LocalHost@xhv46.dial.pipex.com>, Nick Roberts wrote: > > >Ha Ha X 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 | +--------------------------------+