home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / vms / 20479 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.8 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Chris_F_Chiesa
  2. From: Chris_F_Chiesa@cup.portal.com
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Question: Reading keys with command procedures.
  5. Message-ID: <73051@cup.portal.com>
  6. Date: Wed,  6 Jan 93 18:27:19 PST
  7. Organization: The Portal System (TM)
  8. Distribution: world
  9. References:  <930104121153.48acb@JEFLIN.TJU.EDU>
  10. Lines: 30
  11.  
  12. David Gitlin (dgitlin@jeflin.tju.edu) writes:
  13.  
  14. >Is there any way to get a command
  15. >procedure to read a single key stroke without the user having to hit
  16. >enter/return. This would be useful under several conditions. Also can you read
  17. >arrow keys under DCL command procedures. [...] 
  18. >
  19. >(P.S. I know you can do this easily via any programing language like Macro, 
  20. >C, etc I want to know if it can be done strictly from DCL command procedures.)
  21.  
  22. Strictly speaking, NO.  There's no native "get a raw keystroke" verb in
  23. DCL.  
  24.  
  25. It's easy to implement your own, though -- as you have already noted, it's 
  26. easy to "get a keystroke" in any compilable language, and it's also easy to 
  27. assign the obtained keystroke (I recommend VAX BASIC if you have it, because 
  28. its INKEY$ function implicitly parses the function keys for you and returns 
  29. strings such as "UP" for the up-arrow, "DOWN" for the down-arrow, etc. (as
  30. distinguished from you typing D,O,W,N, which would generate a "D" the first
  31. time you called INKEY$, an "O" the second time, etc., e.g.) to a DCL symbol.
  32.  
  33.    (I've implemented a GETKEY verb any number of times; hasn't everybody?
  34. :-)  I even went to the extreme of implementing a system of menus with a 
  35. keystroke-controlled, SMG$-style highlight cursor, in DCL with a homegrown
  36. GETKEY verb - but I don't recommend it, as it was too slow-responding to be
  37. practical...  And before anyone asks, no, I no longer have this code.  I'd
  38. hand it out if I had it, but I don't.)
  39.  
  40.   Chris Chiesa
  41.     Chris_F_Chiesa@cup.portal.com 
  42.