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

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!uwm.edu!ogicse!qiclab!leonard
  2. From: leonard@qiclab.scn.rain.com (Leonard Erickson)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: A Simple TP6 question
  5. Message-ID: <1992Jul21.134054.23075@qiclab.scn.rain.com>
  6. Date: 21 Jul 92 13:40:54 GMT
  7. Article-I.D.: qiclab.1992Jul21.134054.23075
  8. References: <1992Jul20.130530.1@eagle.wesleyan.edu>
  9. Reply-To: 70465.203@compuserve.com
  10. Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
  11. Lines: 37
  12.  
  13. cspradling@eagle.wesleyan.edu writes:
  14.  
  15. >This is a pretty stupid question, but I really stuck with this small piece of
  16. >code and the manual's directions don't work (at least for me). What I want to
  17. >do is have full function of my arrow keys. Since the ascii values are prefixed
  18. >by a null character to distinguish them from the alphanumeric values I am
  19. >having trouble. My turbo pascal manual instructs:
  20.  
  21. >if keypressed then
  22. >   if readkey = chr(0) then
  23. >      if readkey = 'K' then
  24. >          do leftarrow
  25.  
  26.  
  27. >But this doesn't work. Any help on this would be appreciated. Thanks,
  28.  
  29. You have to test for *all possible* extended keys if readkey = chr(0)!
  30. Otherwise you've just lost the keystroke unless it's the first one you
  31. test for!
  32.  
  33. if keypressed then
  34. begin
  35.   if readkey = chr(0) then
  36.      case readkey of
  37.      ....
  38.      'K' : left_arrow;
  39.      ....
  40.      otherwise
  41.         unknown_key;
  42.      end;
  43.   {regular key handling goes here}
  44. end;
  45. -- 
  46. Leonard Erickson              leonard@qiclab.scn.rain.com
  47. CIS: [70465,203]             70465.203@compuserve.com
  48. FIDO:   1:105/56     Leonard.Erickson@f56.n105.z1.fidonet.org
  49. (The CIS address is checked daily. The others infrequently)
  50.