找回密码
 加入
搜索
查看: 1835|回复: 2

[IE类操作] 【已解决】请教 FOR ....IN... IF.....THEN....END.... IF...... NEXT 到底是什么循环

[复制链接]
发表于 2011-1-13 09:10:47 | 显示全部楼层 |阅读模式
本帖最后由 wuquitang 于 2011-1-13 10:13 编辑

这个循环看了很多教程 都说没有用到! 但是我看到很多高手大大的源码里都用到这个循环命令,希望有高手给解释一下
$oInputs = _IETagNameGetCollection ($oIE, "input")

For $oInput In $oInputs
if $oInput.name = "username" then
$oInput.value=$Username
EndIf
Next
发表于 2011-1-13 09:45:43 | 显示全部楼层
其实主要理解For...In...Next 就明白了
枚举对象集合或者数组中的元素
可以看手册的例子……
;使用一个对象集合

$oShell = ObjCreate("shell.application")
$oShellWindows=$oShell.windows

if Isobj($oShellWindows) then
  $string=""

  for $Window in $oShellWindows
    $String = $String & $Window.LocationName & @CRLF
  next

  msgbox(0,"","您打开了下列窗口:" & @CRLF & $String)
else

  msgbox(0,"","您没有打开外壳窗口.")
endif
 楼主| 发表于 2011-1-13 10:13:14 | 显示全部楼层
回复 2# xuzhenjun130


    谢谢!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-12 01:23 , Processed in 0.073860 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表