home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / pascal / 4604 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  640 b 

  1. Path: sparky!uunet!stanford.edu!rutgers!cmcl2!adm!news
  2. From: S105728@umrvma.umr.edu ( Steve Poulsen)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re readkey
  5. Message-ID: <31580@adm.brl.mil>
  6. Date: 29 Jul 92 18:38:21 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 22
  9.  
  10. There is a problem with the readkey example.  If you use readkey and check
  11. for a key, then you lose any further checks.  Here's how I do it:
  12.  
  13. Var
  14.   ch1,ch2:char;
  15.  
  16. Begin
  17.   ch1:=ReadKey;
  18.   Case ch1 of
  19.     32:{space}
  20.     46:{whatever}
  21.      0:Begin
  22.          ch2:=ReadKey;
  23.          Case ch Of
  24.            'K':{arrow}
  25.            ...
  26.          End;
  27.   Else
  28.    ...
  29.   End;
  30.  
  31. This always works good for me.
  32.