home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / GETKEY.ZIP / GETKEY.DOC next >
Text File  |  1988-11-09  |  2KB  |  55 lines

  1.         *    GETKEY.EXE        *
  2. ==============================================================================
  3.  
  4. 1)  Getkey2.exe ..........  Duel mode key capture
  5. 2)  Lines.exe   ..........  Duel mode screen re-sizer
  6. 3)  Input.bat   ..........  Batch file for command.com (DOS)
  7. 4)  Input.cmd   ..........  Batch file for cmd.exe     (OS/2)
  8.  
  9.  
  10.     Getkey2.exe is a short program for OS/2 or DOS that gets an ASCII character
  11. from the keyboard and then passes it to cmd.exe or command.com as a termination 
  12. code which can be read by the 'if errorlevel' statement in a batch file under 
  13. OS/2 or DOS.
  14.  
  15.     This file runs under OS/2 or DOS.  To minimize the files size, it is not
  16. bound:  the DOS code is included in the stub loader and it reads the keyboard
  17. if the program is loaded under DOS (normally the stub loader displays the
  18. message "This program cannot run under DOS", but it can contain different code
  19. code, as it does here).
  20.  
  21.     Lines.exe is a program that toggles the VGA screen between 25 and 50
  22. lines; like getkey2.exe, it runs under both OS/2 and DOS.
  23.  
  24.     Input.bat is a batch file that demos the use of getkey2.exe, and
  25. how branching can be implimented in a batch file, and input.cmd is the
  26. OS/2 version of the file.  They use the same programs and statements,
  27. only the extension is different, allowing the user to have the same util-
  28. ities w/ two operating systems.
  29.  
  30.     This allows user input into batch files, with branching via 'goto' state-
  31. ments as required.
  32.  
  33.     The important thing to remember is that the errorlevel statement returns
  34. 'true' if the input keyboard value in decimal ASCII is equal to or greater
  35. than the variable value to be tested.  It returns 'false ' if the value is
  36. less than the variable (in decimal ASCII).  In the examples used in this file
  37. the values tested are 121 for lower case 'y', and 110 for lower case 'n'.
  38.  
  39.     Obviously, creative branching can be set up by judicious use of the
  40. 'if errorlevel ... ' and 'if not errorlevel  ...' statements ('not' reverses
  41. the conditions under which 'true' is returned) and the 'goto' statement.
  42.  
  43.     Just remember that the actual numbers tested are decimal ASCII.
  44.  
  45.  
  46. =Harve=
  47. Compuserve 72261,347
  48.  
  49.  
  50.  
  51.  
  52.  
  53. =Harve Schiffman=
  54. Compuserve 72261,347
  55.