I'm sorry, but now I am confused. According to the 1.69 lexicon under
Home > Lyceum > Primer > Conditionals and Loops > for Loop
"If
expr2 evaluates to FALSE the loop will break. "
And the code I wrote:
int iLoop;
for (iLoop = 1; iLoop <= 5; iLoop++)
{
if(Random(2)+1 == 2) iLoop--;
}
Doesn't it mean "if iLoop is less than or equal to 5" continue the loop? So if iLoop reached 6, it would break the loop?
But my main question was can I decrement the loop from within it? In the case above say iLoop was equal to 4 (4th loop), the if statement equaled 2, it would decrement iLoop to equal 3? So when the loop cycles, it would be on its 3rd loop rather then 5th. Poor example? Did I just confuse anyone? lol.
TIA
Modifié par Dark Defiance, 06 septembre 2010 - 03:13 .