Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use key <Enter> and <Space> in command 'CHOICE' ?

511 views
Skip to first unread message

mebanna

unread,
Jul 31, 2008, 6:01:38 PM7/31/08
to
For example, there is a command line:
CHOICE /C:1234 /N
Question: Could key <Enter> and key <Space> be used as option keys,
instead of key '3' and '4' upon ?
If it could, what are their standard name for writing into the command
line ?

Any response will be appreciate.

Ted Davis

unread,
Aug 1, 2008, 8:49:49 AM8/1/08
to

Since <Enter> is the command terminator, you may need to work a little
closer to the hardware.

This tiny program (I call it getch.com) returns as errorlevel the ASII
code for the key pressed (for those that have ASCII codes). THis is a
debug script to create the program: debug < script_file.

a
XOR AX,AX
INT 16
MOV AH,4C
INT 21

rcx
8
ngetch.com
w
q

The blank line is essential.

if %errorlevel%==32 tests for a space
if %errorlevel%==13 tests for <Enter>

Another way to handle it, though with the risk of crashing the program if
something else is entered is

goto %errorlevel%
:13
:32

etc.

--
T.E.D. (tda...@mst.edu)

0 new messages