Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Problems with INKEY

Oct
4
0
I've noticed some strange behavior with INKEY.
It doesn't respect the required/allowed characters after /K.
It beeps when other characters are pressed, but it passes control to the next command in the batch file, with an EMPTY return variable. You really don't want that!
I'm running it in TCC-RT under Windows 10 Home.
 
Would be good to know which version you use (for people to help and for possible reproducing).

Would also good to know your exactly command ...
 
OK, so RT is ver. 34
And shortened script is here:
@ECHO OFF

setlocal enabledelayedexpansion
set Eror=0
on error set Eror=1

scrput 08 21 15 on 1 I - report incoming ^>
scrput 10 21 15 on 1 O - report outgoing ^>
scrput 12 21 15 on 1 T - TC33 file
call :akcept "<?IOT"
if %Pres%==< goto:EOF
if %Pres%==I goto incom
if %Pres%==O goto outgo
if %Pres%==T goto tc33
goto:EOF

:tc33

:incom

:outgo

goto:EOF

rem ================ called procedures

:akcept
scrput 10 05 15 on 2 Ű
screen 10 05
inkey /K%1 /P /X %%Pres
if %Pres%==? set "Pres=<"
goto:EOF
 
When I do this

Code:
v:\> inkey /k%"YN" prompt %%var

It accepts the X key, makes the default asterisk sound, returns to the prompt, and doesn't set the variable.
 
Back
Top