home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
batutl
/
battutor.arc
/
_QUERY.BAT
< prev
next >
Wrap
DOS Batch File
|
1983-08-21
|
2KB
|
64 lines
echo off
. _query.bat revised 15-aug-83 17:00
more <_query.rem
slash/l
pause
:start
slash/l
query Is this example easy (y/n) ?
if errorlevel 2 goto esc_key
if not errorlevel 1 goto n_key
echo You typed a "Y" or a "y"
goto continue
:n_key
echo You typed an "N" or an "n"
goto continue
:esc_key
echo You pressed the Esc key
:continue
slash/lll
echo In the next few examples, we're just going to show some different
echo forms of the QUERY command line, so we won't bother to do any testing
echo with IF subcommands. Just put a finger on the "N" key and tap it
echo as each example prompt appears.
echo (or, to see QUERY's error message, type another key).
slash/lll
echo We first show the command line in a comment, then we execute it.
slash/ll
echo Command line: query Type y/n to continue :
query Type y/n to continue :
slash/l
echo Command line: query /l/We skipped one line before this prompt :
query /l/We skipped one line before this prompt :
echo Command line: query /llb/We skipped two lines and beeped :
query/llb/We skipped two lines and beeped :
echo Command line: query No slashes, so leading blanks are gone :
query No slashes, so leading blanks are gone :
slash/l
echo Command line: query // But slashes keep them :
query // But slashes keep them :
slash/l
echo Command line: query/ldl/ Delimiting helps keep display organized :
query/ldl/ Delimiting helps keep display organized :
slash/lll
echo You may leave out the prompt string altogether ( but a suitable prompt
echo should be displayed in preceding comments ).
slash/ll
echo For example, let's execute the command line: query
query
slash/ll
echo And here's the execution of the command line: query /LLB
query /LLB
slash/llll/ If you want to repeat these examples, type "y"
query /l / Else type "n" to continue :
if errorlevel 2 goto exit
if errorlevel 1 goto start
_funky.bat
:exit
slash/ll/ Bye bye
---
goto lookmore
:exit
slash/11/ Bye bye