home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / VRAC / DCH101.ZIP / DCH.DOC next >
Encoding:
Text File  |  1993-09-07  |  4.5 KB  |  137 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                       DCH
  7.                        Free DOS utility: batch file query
  8.                        Version 1.01 - September 07, 1993
  9.                                     (c) 1993
  10.                                        by
  11.                              David Daniel Anderson
  12.                                    Reign Ware
  13.  
  14.  
  15.  
  16.  
  17.  
  18. DCH reads a keystroke and sets the DOS errorlevel accordingly.
  19. Timeout, valid keys, prompt and color are easily configurable.
  20.  
  21.  
  22.                              USAGE:
  23.                              ------
  24. DCH timeout_spec keys [text]
  25.  
  26.                             EXAMPLES:
  27.                             ---------
  28.  
  29. DCH [10] YynN Do you wish to continue [Y/n]?
  30. DCH [] NnyYaA Do you wish to continue [y/N/a]?
  31. DCH [0] h     Try and stop me...
  32. DCH [4000] ~. Guess one of the magic keys!
  33. DCH [10] yn
  34.  
  35. ("Text" is optional, but "timeout_spec" and "keys" are mandatory.)
  36.  
  37.  
  38.                           TIMEOUT_SPEC:
  39.                           -------------
  40. The timeout_spec must begin with:  [  and end with:  ]
  41.  
  42. [] will disable the timeout.  Then DCH will wait forever for a key.
  43.  
  44. [0] will set the timeout to 0, which will cause DCH to check for a
  45.     keystroke in the keyboard buffer.  DCH will use it if it exists,
  46.     but default (as usual) to the first of the specified keys if not.
  47.  
  48. [65535] is the maximum specifiable timeout period - over 18 hours.
  49.  
  50. If the specified time expires without a valid keypress, then the errorlevel
  51. is set to the -position- of the first of the valid keys (errorlevel=1).
  52.  
  53.  
  54.                               KEYS:
  55.                               -----
  56. Case is always sensitive, so Y and y are -not- identical keys.
  57.  
  58. The keys can be any displayable characters from the standard IBM ASCII
  59. character set, with the exception of: space, <, >, and |.
  60.  
  61. The DOS errorlevel will contain a number equal to the -position- of the
  62. pressed key within the "valid keys" string.
  63.  
  64. In other words, the first key you assign returns a value of 1, the second
  65. a value of 2, the third a value of 3, and so on.
  66.  
  67. If the user presses a key that is not amongthe keys you assigned, DCH
  68. forces the user to press another key, until the time allotted has passed.
  69. If the time expires, DCH selects the first assigned key as the default.
  70.  
  71. If a parsing error (anticipated) occurs, DCH returns a value of 201-210,
  72. and then writes the error number and reason for the error.
  73.  
  74.  
  75.                               TEXT:
  76.                               -----
  77. All text after the final specified key will be displayed as a prompt,
  78. and can include any displayable ASCII characters except: <>|
  79.  
  80. Thus you cannot use:  DCH [7] yn Are you human <y|n>?
  81.  
  82. The key that the user presses will be written to the screen if and
  83. -only- if there is text on the command line.
  84.  
  85.  
  86.                               COLOR:
  87.                               ------
  88. Finally, you -may- choose what color you want the text to be displayed
  89. in by using the DOS SET command to SET an environmental variable:
  90.  
  91. DCHCLR=nnn  - where nnn is the decimal of the color value (0-255).
  92.  
  93. For example, to set the color of the output to White on Blue, use:
  94.  
  95. SET DCHCLR=31
  96.  
  97. Calculate the value by adding foreground + background + blink.
  98.  
  99. Foreground            Background          Blink
  100. ----------            ----------          -----
  101. 00 = Black            00 = Black          00 = Off
  102. 01 = Blue             16 = Blue          128 = On
  103. 02 = Green            32 = Green
  104. 03 = Cyan             48 = Cyan
  105. 04 = Red              64 = Red
  106. 05 = Magenta          80 = Magenta
  107. 06 = Brown            96 = Brown
  108. 07 = Light gray      112 = Light gray
  109. 08 = Dark gray
  110. 09 = Light blue
  111. 10 = Light green
  112. 11 = Light cyan
  113. 12 = Light red
  114. 13 = Light magenta
  115. 14 = Yellow
  116. 15 = White
  117.  
  118.  
  119. Note:  DCH is derived from: (D)ave's (CH)oice.
  120.  
  121. [end of text]
  122.  
  123. {------------------------------------------------------------------------------
  124.  
  125.                                 REVISION HISTORY
  126.  
  127. v1.00  : 1993/08/25.  First public release.  DDA
  128. v1.00a : 1993/08/30.  Minor tuning of .PAS code.  DDA
  129. v1.01  : 1993/09/07.  Changed program so that user -must- press one of the
  130.                               valid keys.  Timeout will still default to
  131.                               the first though.  DDA
  132.                       The key pressed will now only be echoed if the
  133.                               user is having DCH display a message also.  DDA
  134.  
  135. ------------------------------------------------------------------------------}
  136.  
  137.