Code: Select all
; List the key-value pairs of an object:
colours := Object("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00)
; The above expression could be used directly in place of "colours" below:
for k, v in colours
s .= k "=" v "`n"
MsgBox % s
However, this ...
Code: Select all
Things := Object()
Loop 5
{
Thing := Object()
Thing.Name := "Name" . A_Index
Things.Push(Thing)
}
for Thing in Things
p .= Thing.Name
MsgBox % p