11-06-2022, 12:50 PM
(11-06-2022, 11:51 AM)Chris Wrote: HelloWelcome to the forums. Next time please try to use a better topic name than "Code fix" because it's too curt.
Please modify the code.
Also your style of programming could use some improvement. Line numbers as well as "WHILE... WEND"? Why?
You need to use "ASC()" function to check the ASCII codes of the result of "INKEY$" if you only desire numerals, which are from 48 (zero) to 57 ("9"). So far you're only checking special keys which aren't alphanumerics.
Using "VAL()" is a bit complicated because if the user types zero first, that function doesn't tell the difference if that's what it is, or if it's not a numeral. Therefore might want to set the start of the range to "1" which is CHR$(49).