Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is wrong with this for/next loop
#5
(04-14-2025, 01:00 PM)Helium5793 Wrote: Why is i%  6 after it comes out of the for/next loop?
I am running QB64e under fedora linux.  Not sure how to find the version number, but the installation files all have 12/13/2024 as the date modified on them so it isn't an old version.
This has nothing to do with Basic; it's the same in C. The reason is simple: 
The loop is executed until it detects that the final count will be exceeded on a subsequent iteration. However, the counter variable "i" contains the last value, which in this case is "6."

[Image: For-Schleife-QB64-C.jpg]
Reply


Messages In This Thread
RE: What is wrong with this for/next loop - by Kernelpanic - 04-15-2025, 01:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exiting sub while inside a loop PhilOfPerth 5 525 12-05-2025, 09:40 AM
Last Post: PhilOfPerth
  Do Loop, Sleep and Mouse Button Dimster 5 599 09-06-2025, 12:57 PM
Last Post: Dimster
  Using modulo to loop through lists fistfullofnails 3 723 09-03-2025, 11:50 PM
Last Post: fistfullofnails
  Simple Addition gone wrong Dimster 13 1,469 08-22-2025, 09:00 PM
Last Post: Pete
  Either I'm doing MID$( wrong or it has a bug TDarcos 4 813 04-13-2025, 11:14 PM
Last Post: TDarcos

Forum Jump:


Users browsing this thread: 1 Guest(s)