id := 0
items := Object(++id, "a", ++id, "b", ++id, "c", ++id, "d")
for key, values in items
msgbox % key " , " values
id := 10
items := Object(--id, "a", --id, "b", --id, "c", --id, "d")
for key, values in items
msgbox % key " , " values
Using either pre increment or pre decrement as associative array key only the last key-value pairs defined in the object ("d") are added, all the other values are ignored and not appears in the result array values, i need to use pre increment since i need the incremented value of the variable not the original value, anyway this is a bug since the same code above but with post increment or post decrement keys work correctly as described here https://www.autohotkey.com/docs/Variables.htm#Operators :
Pre- and post-increment/decrement. Adds or subtracts 1 from a variable (but in versions prior to 1.0.46, these can be used only by themselves on a line; no other operators may be present). The operator may appear either before or after the variable's name. If it appears before the name, the operation is performed immediately and its result is used by the next operation. For example, Var := ++X increments X immediately and then assigns its value to Var. Conversely, if the operator appears after the variable's name, the operation is performed after the variable is used by the next operation. For example, Var := X++ increments X only after assigning the current value of X to Var. Due to backward compatibility, the operators ++ and -- treat blank variables as zero, but only when they are alone on a line; for example, y:=1, ++x and MsgBox % ++x both produce a blank result when x is blank.