SpaceTown-Developers / Lemon-Gate

Expression Advanced a Lua sub language.
Other
15 stars 5 forks source link

For loop problem, looping one time more than expected. #175

Closed guillaume-dorczynski closed 10 years ago

guillaume-dorczynski commented 10 years ago

There is actually a small problem with for loops, I believe this is recent and it worked fine before.

Actually if you do for example:

for ( number I = 1; I < 4; I++ )
{
    print( I )
}

It will print: 1, 2, 3, 4. Previously (but I can be wrong), and in any other scripting languages using these kind of loops, it would only print 1, 2, 3. As demonstrated here, if you need a proof: http://codepad.org/oEQp9lSO

Rusketh commented 10 years ago

We changed the background code for ours loops, for speed and performance recently. I knew I hadn't got away with out breaking something, I will fix it ready for the next commit.