Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  VS Code and Qb64 pe Unseen Machine 6 734 09-03-2025, 09:42 PM
Last Post: grymmjack
  has anyone had ChatGPT write QB64 code yet? madscijr 13 2,969 08-23-2025, 09:15 AM
Last Post: doppler
  liquid code experiment madscijr 3 495 06-20-2025, 07:26 PM
Last Post: madscijr
  [split] Lines of Code bplus 20 3,067 01-25-2025, 05:11 PM
Last Post: Pete
  QB64 GPT Just Rewrote My Code SpriggsySpriggs 17 2,870 05-30-2024, 06:50 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)