home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc
/
reply.lzh
/
REPLY.DOC
< prev
Wrap
Text File
|
1985-05-23
|
3KB
|
73 lines
Batch
Commands
REPLY Subcommand
Purpose: Requests a user input and matches that reply against a list of valid
replies. ERRORLEVEL is set depending upon the match.
Note: This subcommand requires DOS 2 or later and will produce an
error if used with DOS 1.
Format: REPLY[/U] [string]
string element [element ...]
A string may contain at most 8 elements.
element any ASCII characters not including a space, the piping
character, or the redirection characters. The maximum
length of an element is 64 characters.
Note: elements must be separated by one or more blanks. The
length of string is restricted by the limit of 127 characters for
any complete DOS command.
Type: Internal External
***
Remarks: The /U parameter causes both the parameter string and the input reply
to be converted to upper case, thus making the match case
insensitive.
The subcommand writes the output request for a reply to the standard
output device and accepts the input reply from the standard input
device. These may be redirected or piped. Error messages are
written to the standard error device.
The subcommand sets the ERRORLEVEL exit code upon completion. The
value depends upon the match between the input reply and the elements
of the parameter string.
0 = no input reply entered
1 thru N = for a parameter string of N elements, the value set is
the number of the element which the input reply exactly
matches
N+1 = input reply does not exactly match any of the N elements in
the parameter string
The REPLY subcommand has two format options:
Option 1 - No parameter string specified
Use this option to request a reply to a Yes/No question. The /U
parameter is automatically set if this option is chosen, and is
ignored if specified. A default parameter string is constructed of
two elements in this order: Y N
REPLY is equivalent to REPLY/U Y N
Option 2 - Parameter string specified
Use this option to request a reply from an arbitrary list of choices.
Example: ECHO Do you wish to continue? (Y/N)
REPLY
IF ERRORLEVEL 3 GOTO bad
IF ERRORLEVEL 2 GOTO no
IF ERRORLEVEL 1 GOTO yes
REM This is the default action
-----------------------------------------------------------------------------
Program REPLY, Copyright(C) October 1984, MJH Consulting. Permission granted
to copy for non-commercial uses only. All other rights retained.