home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!seas.gwu.edu!mfeldman
- From: mfeldman@seas.gwu.edu (Michael Feldman)
- Subject: Re: DATA_ERROR exception problem
- Message-ID: <1992Nov6.035429.3410@seas.gwu.edu>
- Sender: news@seas.gwu.edu
- Organization: George Washington University
- References: <X7D8JTH@math.fu-berlin.de> <EACHUS.92Nov4202155@oddjob.mitre.org>
- Date: Fri, 6 Nov 1992 03:54:29 GMT
- Lines: 31
-
- In article <EACHUS.92Nov4202155@oddjob.mitre.org> eachus@oddjob.mitre.org (Robert I. Eachus) writes:
- >
- > The proper solution is to call Skip_Line after each call to Get,
- >unless your user interface specification permits more than one integer
- >value per line. In that case you can either do a Skip_Line on error,
- >or read into a String, and parse "by hand" when invalid input is
- >encountered. (I really suggest in any case throwing the queued input
- >away when an error is encountered, but especially in an introductory
- >class!)
- >
- Yep. That's how most of us teach it. Interestingly, many students - even
- freshmen - want to know if there's a better way, so that input data can
- be "batched" on a line. If they've studied strings yet, I tell them about
- the "read it into a string" solution, let 'em know it's possible, and
- go back to the Skip_Line thing.
-
- Mike Feldman
- ------------------------------------------------------------------------
- Michael B. Feldman
- co-chair, SIGAda Education Committee
-
- Professor, Dept. of Electrical Engineering and Computer Science
- School of Engineering and Applied Science
- The George Washington University
- Washington, DC 20052 USA
- (202) 994-5253 (voice)
- (202) 994-5296 (fax)
- mfeldman@seas.gwu.edu (Internet)
-
- "Americans wants the fruits of patience -- and they want them now."
- ------------------------------------------------------------------------
-