Bug #573
Inkey$ captures previous input character
Start date:
11/16/2020
Due date:
% Done:
0%
Estimated time:
Affected version:
Description
If you just press return this shouldn't print "not blank", but it does. Temp2 contains the return char so tests for an empty string fail:
#manifest: "aoz"
input temp$
wait 1
temp2$=inkey$
if temp2$<>"" then print "not blank"
wait key
end
I put in a wait just to prove it wasn't getting the key from the speed of it running when the key is still pressed from the input line.
Updated by Paul Kitching over 3 years ago
Putting in a CLEAR KEY doesn't get rid of it, and neither does setting the variable to "".
The only way I can get rid of it is to put in a WAIT KEY that accepts it (and therefore doesn't wait).