View Single Post
Old 13th February 2010, 18:23   #27
Nitorami
Major Dude
 
Join Date: Mar 2008
Location: Erlangen
Posts: 872
Hmm, maybe I was too optimistic... either have misinterpreted the syntax or it is still buggy.

This code should result in index=5

index = 0;
while (below(index,5); index=index+1; );

but actually delivers 1; the while loop stops prematurely. For any other increment than 1, it will stop one cycle later than expected; e.g. for increment 20, index ends up at 40 instead of 20.


In this code

index = 0;
while (below(index,-5); index=index+1; );

the while loop would, to common understanding, not be executed at all but it actually runs once and also results in index = 1.
Better don't use while loops for now. Still hope they will be implemented in the final version.
Nitorami is offline   Reply With Quote