Code fix
#3
(11-06-2022, 11:51 AM)Chris Wrote: Hello
Please modify the code.
Welcome to the forums. Next time please try to use a better topic name than "Code fix" because it's too curt.

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).
Reply


Messages In This Thread
Code fix - by Chris - 11-06-2022, 11:51 AM
RE: Code fix - by OldMoses - 11-06-2022, 12:24 PM
RE: Code fix - by mnrvovrfc - 11-06-2022, 12:50 PM
RE: Code fix - by OldMoses - 11-06-2022, 12:55 PM
RE: Code fix - by SMcNeill - 11-06-2022, 12:59 PM
RE: Code fix - by OldMoses - 11-06-2022, 01:11 PM
RE: Code fix - by SMcNeill - 11-06-2022, 01:20 PM
RE: Code fix - by Chris - 11-06-2022, 01:09 PM
RE: Code fix - by SMcNeill - 11-06-2022, 01:27 PM
RE: Code fix - by Dimster - 11-06-2022, 01:42 PM
RE: Code fix - by SMcNeill - 11-06-2022, 02:09 PM
RE: Code fix - by mnrvovrfc - 11-06-2022, 02:46 PM
RE: Code fix - by SMcNeill - 11-06-2022, 03:19 PM
RE: Code fix - by Dimster - 11-06-2022, 02:53 PM
RE: Code fix - by Pete - 11-06-2022, 06:21 PM
RE: Code fix - by Kernelpanic - 11-06-2022, 09:43 PM



Users browsing this thread: 5 Guest(s)