For Key [, Value] in Expression 对对象中的每对键值对重复执行一系列命令.
下面是实例:
For-loop
···
; 列出对象中的键值对:
colours := Object
("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00); 上面的表达式可以直接代替下面的"colours":
for k, v in colours s .= k "=" v "`n"MsgBox % s
···
; 列出所有的资源管理器和 Internet Explorer 窗口:
for window in ComObjCreate
("[Shell.Application
").Windows windows .= window.[LocationName
" :: " window.[LocationURL
"`n"MsgBox % windows