comp.lang.ada
 help / color / mirror / Atom feed
From: seas.gwu.edu!mfeldman@uunet.uu.net  (Michael Feldman)
Subject: Re: DATA_ERROR exception problem
Date: 6 Nov 92 03:54:29 GMT	[thread overview]
Message-ID: <1992Nov6.035429.3410@seas.gwu.edu> (raw)

In article <EACHUS.92Nov4202155@oddjob.mitre.org> eachus@oddjob.mitre.org (Robe
rt 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."
------------------------------------------------------------------------

             reply	other threads:[~1992-11-06  3:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-11-06  3:54 Michael Feldman [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-11-01 16:55 DATA_ERROR exception problem Michael Feldman
1992-10-31  6:34 munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!cs.adelaide.edu.au!
1992-10-29 21:26 David Erickson
1992-10-29 10:44 bloom-picayune.mit.edu!snorkelwacker.mit.edu!ira.uka.de!ira.uka.de!math.f
replies disabled

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