home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / ada / 3205 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.7 KB  |  43 lines

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