Article View: comp.os.msdos.misc
Article #3988The CHOICE utility for DOS 5 and DOS 6.xx (repost)
From: John Savage
Date: Tue, 31 Jan 1995 06:54
Date: Tue, 31 Jan 1995 06:54
62 lines
3442 bytes
3442 bytes
The CHOICE utility is available by anonymous ftp, and runs perfectly on DOS 5.
There is another, GET_FUNC, which can be used to await a F1-F10 keypress.
ftp ftp.microsoft.com
cd /Softlib/mslfiles
get sup622.exe (quite a large file at 781125 bytes)
When run on your PC, this creates about 70 files; one of these is
EXPAND.EXE and is needed for uncompressing the files you want.
e.g., expand choice.co_ choice.com
Example: CHOICE.COM {awaits one of the specified keypresses}
-------------------
echo A: All the components
echo S: Selected components only
echo X: Exit
echo.
choice /c:asx "All, Selected, Exit "
if errorlevel 3 goto done { keypress is x }
if errorlevel 2 goto checkdir { keypress is s }
{ keypress is a }
Example: GET_FUNC.COM {awaits function key F1-F10 keypress}
---------------------
echo Press F1 F2 F3 or F4
:get_key
get_func
if errorlevel 62 if not errorlevel 63 goto F4
if errorlevel 61 if not errorlevel 62 goto F3
if errorlevel 60 if not errorlevel 61 goto F2
if errorlevel 59 if not errorlevel 60 goto F1
goto get_key
:F4
echo That was F4 key
Usage: C:\> CHOICE /?
---------------------
Waits for the user to choose one of a set of choices.
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]
/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display
ERRORLEVEL is set to offset of key user presses in choices.
__ __
:--_-_-_--. _____________________________ { \_____/ } __________
| (_|_|_) | { }
. | (_|_) | '~. `[ ]` .~' Australia,
_--_|\ |---------' John Savage (visitor) (.__=-- ) beautiful
/ \| Sydney guest account courtesy: _/ ~~~~~ \_ one day -
\_.--._/^ 2000 Macquarie University (w w) perfect
v OLYMPICS Sydney Australia ( ) the next.
\__ _ __/
===========internet: johns@macadam.mpce.mq.edu.au===== \_) (_/ =============
Technical Details
Message-ID:
<3gkmra$ce8@sunb.ocs.mq.edu.au>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!cs.utexas.edu!uwm.edu!msunews!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!sunb.ocs.mq.edu.au!macadam.mpce.mq.edu.au!johnsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d683,a9094d32f55c9884,start X-Google-Attributes: gid10d683,public X-Google-Thread: f71eb,a9094d32f55c9884,start X-Google-Attributes: gidf71eb,public X-Google-Thread: 111d31,a9094d32f55c9884,start X-Google-Attributes: gid111d31,public X-Google-Thread: 1674b9,a9094d32f55c9884,start X-Google-Attributes: gid1674b9,public X-Google-ArrivalTime: 1995-01-30 22:54:34 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!cs.utexas.edu!uwm.edu!msunews!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!sunb.ocs.mq.edu.au!macadam.mpce.mq.edu.au!johns From: johns@macadam.mpce.mq.edu.au (John Savage) Newsgroups: comp.os.msdos.misc,comp.binaries.ibm.pc.wanted,comp.archives.msdos.d,aus.computers.ibm-pc Subject: The CHOICE utility for DOS 5 and DOS 6.xx (repost) Date: 31 Jan 1995 06:54:34 GMT Organization: Macquarie University Lines: 62 Message-ID: <3gkmra$ce8@sunb.ocs.mq.edu.au> NNTP-Posting-Host: macadam.mpce.mq.edu.au