Programming 101: Don't use a FOR loop unless you know the number of times you want the loop executed. And certainly don't change the loop variables inside the loop. I scream every time I see:
x = 10
For i = 1 to x
do something
if WeAreDone then x = 1
next i
Lazy lazy lazy. This is stuff C programmers do all the time. Drives me crazy. Plus, it makes debugging big loops a nightmare. This is what WHILE is for.
Anyway, I was just asking to know if I had to use a temp variable to store the computed result, or if it works the way _I_ think it should and optimizes it.
And I was too lazy to write my own test.
Thanks all.