﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2708	"re calculate ""to"" statment in ""for ... to"" loop"	TommyDDR		"Should be the behavior of a for loop is the same as in other major programming languages.

Exemple showing that ""getMax"" is called only once.
{{{
For $i = 0 To getMax()
	ConsoleWrite(""$i = "" & $i & @LF)
Next

Func getMax()
    Local $rand = Random(5, 10, 1)
    ConsoleWrite(""getMax() : "" & $rand & @LF)
    Return $rand
EndFunc
}}}

The output condition is currently not recalculated each loop while in C, C + +, java, it is. This could avoid some ""dimension range excedeed"" for example.

Exemple showing ""dimension range excedeed"" :

{{{
Global $tab = [1, 2, 3, 4, 5]

For $i = 0 To UBound($tab, 1)-1
    ConsoleWrite($tab[$i] & @LF)
    ReDim $tab[3]
Next
}}}
"	Bug	closed		AutoIt	3.3.8.1	None	No Bug		
