While writing a small grub4dos batch subroutine to limit the input (allowed key presses) in the batch I found by mere chance a strange quirk .
Some strings (composed of hex number characters) evaluate wrongly.
First occasion found was that I intercepted all keys but [ENTER], still a (and A) and s (and S) "went through".
the code used was
pause --test-key | set testkey=
if %testkey%.==1c0d. call :do_input
in theory you can press all the keys you want and none but [ENTER] would "go through" the subroutine.
BUT in practice also a, A, s and S went through.
Try this batch:
!BAT setlocal pager off :loop #press [End] key to exit pause --test-key | set thiskey= if "%thiskey%"=="4f00" goto :eof set Enter=1c0d if %thiskey%==%Enter% echo %thiskey%==%Enter% match if %thiskey%.==%Enter%. echo %thiskey%.==%Enter%. match if not .%thiskey%==.%Enter% echo .%thiskey%==.%Enter% DO NOT match if not "%thiskey%"=="%Enter%" echo "%thiskey%"=="%Enter%" DO NOT match echo goto :loop
The number of possible collisions is nearly infinite
Try on command line:
if 1a4==1b5 echo Same
or
if 2a==2b echo Same
but also:
if 2c==2f0 echo Same
And
if 3r==3F0518CD echo Same
BUT
if 3k==3F0518CD echo Same
behaves differently.
It seems that the first character on both sides of the == must be a number, then some (but not all) letters would do.
Tested on 0.4.6a 2021-05-16.
Wonko