Hi KG.
It's EXACTLY the same thing. Instructions have been reordered in memory, but it's absolutely a
while-wend loop. Try to follow the code and compare the order in which the instructions are executed. It's
the same.
The only difference is that in the way I written it there is
one less instruction executed for loop, so it should be more efficient (keeping the other instructions constant).
As I said, if I'm not missing something...
About your question: conditional or not have no impact (it's not like a
if then goto instead of a
goto). I believe the important thing to evaluate a jump is if it has been executed or not, and marginally if it's a near jump or a long one. It's always better to not jump and follow through instead, because jumping alter the efficiency of retrieving the code from the cache, anyway this is not relevant in the code above. And I don't want to talk about branch prediction either!
That's one of the reasons why writing the same code 3 times in sequence is usually faster than include the code in a
for k =1 to 3 : next loop.
Anyway, it's a suggestion, Fred will do what he want with it. But frankly changing something so simple from time to time and make the code generated always better should be a good thing no ? Maybe someone else will spot something else in the future and so on... oh well.
Let's see what happen with this first, no sense in looking for more if this will not be considered !