Type Sized For Loops

BlitzMax Forums/BlitzMax Programming/Type Sized For Loops

When the type reaches the upper limit of what numbers it can represent, the for-next loop adds 1 to it for the next iteration before testing to see whether to do another iteration, and since adding 1 to the upper limit makes 0, it is fooled to thinking there is more to do so it keeps going. It's not so much a bug it's just they haven't deliberately placed a protective mechanism in there to detect when this is happening.

You can change your loop type to something else, like a while-wend or repeat-until loop, and manage the counter yourself using bytes or whatever you want - you can then error-check for the upper limit being reached.