Mahan wrote:
Maybe it's a matter of habit but I almost never write repeat..until loops anymore. I only use while..wend, for..next and foreach..next loops.
I almost never use While...Wend loops
Maybe because I have the ASM habit, generally the test is after the code to avoid a jump.
As an old VB programmer I cannot think of a single time I didn't need to check the values first when using for next loops with non-static values, so I am in favour of the way PB handles them, it's less steps for the programmer, IMHO. Classic basic never checked if the 'range' was invalid and so always iterated once, meaning you could execute once even if the end condition was met (or exceeded).
As for While and Repeat, this is why we have them both, I am guessing, so we can decide whether to check before or after the code block, it's all about preference and how your particular program flow is configured.
In summary, I prefer this 'pre-loop' checking on For loops, makes more sense to me.
----------------------------------------------------------------------------
Commenting your own code is admitting you don't understand it.
----------------------------------------------------------------------------