home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7951 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.3 KB

  1. Xref: sparky comp.lang.pascal:7951 comp.os.msdos.programmer:11875
  2. Newsgroups: comp.lang.pascal,comp.os.msdos.programmer
  3. Path: sparky!uunet!math.fu-berlin.de!news.belwue.de!news.uni-stuttgart.de!delos!sinus!stefan
  4. From: stefan@sinus.stgt.sub.org (Stefan Bechtold)
  5. Subject: Case/readln Question
  6. Message-ID: <1993Jan6.004700.207@sinus.stgt.sub.org>
  7. Organization: Sinus Stuttgart, Germany
  8. Date: Wed, 6 Jan 1993 00:47:00 GMT
  9. Lines: 27
  10.  
  11. Hi !
  12.  
  13. I've a question;
  14. What I want to do is a menue with 15 items; therefore I've to use
  15. the case statement under TurboPascal6.
  16.  
  17. But if I use char-type for the variable which is controlled
  18. by case it doesn't work as the case-statement only accepts
  19. 1..9, not numbers with two digits (as 10..15).
  20.  
  21. So I could use integer-type where it works, in fact. But when I use integer and
  22. type some char like a letter (e.g. 'A') , the case-loop exits (as
  23. 'A' is a char/string, but no integer).
  24.  
  25. What I want to do:
  26. I want to control 15 numbers by a case-statement (so I do have to use
  27. integer, doesn't I ?), but also want to control all other chars typed in
  28. (so that the program doesn't exit but prints an error message.)
  29.  
  30. Do you have any solution ?
  31.  
  32. Thank you very much in advance,
  33. Stefan
  34. -- 
  35. + Stefan Bechtold # stefanb@delos.stgt.sub.org # Voice +49 711 813240 +
  36. ++++++++sed nemo potuit tangere: merda fuit ! (Martial III 17)+++++++++
  37.  
  38.