home *** CD-ROM | disk | FTP | other *** search
-
- BE ASK
-
-
-
- Description: Displays a prompt message and then awaits single-key input.
- You can supply a list of keys that defines the key response BE
- ASK will accept, a default key value, a timeout period, and
- color attributes for the prompt message. If you provide
- (keylist), BE ASK returns ERRORLEVEL, which you can test with
- an IF batch command to control the flow of commands in a batch
- command file. If you are nesting BE ASK commands within a menu
- system, you can adjust the ERRORLEVEL that is returned to
- discover which menu set the returned code.
-
-
-
- Syntax: Version 4.5: BE ASK "(prompt)" [[,](keylist)]
- [DEFAULT=(key)] [TIMEOUT=(n)] [ADJUST=(n)]
- [[BLINKING] [BRIGHT | BOLD] [(text-color)]
- [[ON] (back-color)]]
-
-
-
- Parameters:
-
-
-
- (prompt) A character string BE ASK displays while waiting for input.
- You must enclose the prompt in quote marks if it includes one
- or more blank spaces. If the prompt contains a single-quote
- character, enclose the prompt in double-quote marks. If the
- prompt contains a double-quote character, enclose the prompt
- in single-quote marks.
-
- (keylist) A list of the character keys, number keys, or symbol keys that
- ASK will accept as a response. The list must be a single
- string of characters with no spaces between them (Example:
- ABCD, not A B C D). When you supply (keylist), BE ASK sets the
- ERRORLEVEL based on the position in the list of the key you
- choose;. Using the above example, pressing A sets ERRORLEVEL
- equal to 1, pressing B sets ERRORLEVEL equal to 2, and so on.
- If you do not specify (keylist), pressing any key completes
- execution of BE ASK with ERRORLEVEL set to 0.
-
- Example: BE ASK ABCD - If a user chooses "C", ERRORLEVEL will be set to
- 3.
-
-
- DEFAULT=(key) The default key value in (keylist) that BE ASK uses if the
- optional timeout elapses or if you press Enter.
-
- TIMEOUT=(n) A time period, in seconds, that BE ASK waits prior to
- proceeding. If you specify a default key and if the time
- period expires, BE ASK returns the ERRORLEVEL value
- corresponding to that key. If you do not specify a default
- key, BE ASK sets the ERRORLEVEL value of the *last key* in
- (keylist); if you do not specify (keylist), BE ASK sets a
- value of 0.
-
- ADJUST=(n) A numeric value BE ASK adds to the returned ERRORLEVEL code to
- adjust for stacked menus.
-
- BLINKING Causes the prompt message to blink on and off. On some
- monitors this keyword works only if you specify (back-color).
-
- BRIGHT | BOLD Displays the prompt message as high intensity.
-
- (text-color) The color of the prompt message text and a response character.
- The default is the current foreground color setting for the
- screen area that is covered by the text. See <NUBESA>.
-
-
-
-
-
-
- (back-color) The color of the background block for the prompt message and
- response character. If you do not provide (text-color), you
- must include the ON keyword. The default is the current
- background setting for the screen area that is covered by the
- text. See <NUBESA>.
-
- Notes:
-
- The DOS batch command IF ERRORLEVEL (n) evaluates to true whenever (n) is
- less than or equal to the current ERRORLEVEL. To obtain the results you want
- from a set of IF ERRORLEVEL commands, test for the highest possible
- ERRORLEVEL first. See the example below.
-
- The BE ASK command in version 4.5 replaces the ASK command available in
- version 4.0.
-
-
-
-
-
-
-
-
-
-
- Example: To display a bright-red-on-yellow prompt that provides a
- choice between continuing in a batch file and quitting and
- that has a default value of Q if the user does not respond
- within 30 seconds, enter:
-
-
- BE ASK "Enter C to continue or Q to quit: ",CQ D=Q T=30 BRI RED ON YEL
- IF ERRORLEVEL 2 GOTO QUIT
- :CONTINUE
- . additional commands
- .
- . additional commands
- :QUIT
- REM Last line in the batch file
-
- See: <NUBE>, <NUBESA>, <NUSAMP>, <NUCOLOR>.
-
-