找回密码
 加入
搜索
查看: 2049|回复: 1

[AU3基础] Do....Until 循环問題

[复制链接]
发表于 2014-4-15 19:31:28 | 显示全部楼层 |阅读模式
$t = "系统配置实用程序"

Run('msconfig.exe')
WinWaitActive ($t)
ControlCommand ( $t, "", 'SysTabControl321' , "TabRight")
ControlCommand ( $t, "", 'SysTabControl321' , "TabRight")
ControlCommand ( $t, "", 'SysTabControl321' , "TabRight")
ControlCommand ( $t, "", 'SysTabControl321' , "TabRight")
Sleep(500)
ControlListView ( $t, "", 'SysListView321', "SelectClear")
$i = 1
Do
Sleep(1000)
$n = FileReadLine("D:\test.txt", $i)
$G = ControlListView($t, "", "SysListView321", "FindItem", $n, 0)
ControlListView ( $t, "", 'SysListView321',"Select", $G)
$i += 1
Sleep(1000)
Until @error

-------------------------------------------------------------
要在TXT读取完后,结束程序!
请问是哪里写错吗?
发表于 2014-4-15 20:21:38 | 显示全部楼层
$t = "系统配置实用程序"

Run('msconfig.exe')
WinWaitActive($t)
ControlCommand($t, "", 'SysTabControl321', "TabRight")
ControlCommand($t, "", 'SysTabControl321', "TabRight")
ControlCommand($t, "", 'SysTabControl321', "TabRight")
ControlCommand($t, "", 'SysTabControl321', "TabRight")
Sleep(500)
ControlListView($t, "", 'SysListView321', "SelectClear")

$file = FileOpen("D:\test.txt")
If $file = -1 Then Exit MsgBox(0, "错误", "不能打开文件.")

Do
        Sleep(1000)
        $n = FileReadLine($file)
        If @error = -1 Then ExitLoop
        $G = ControlListView($t, "", "SysListView321", "FindItem", $n, 0)
        ControlListView($t, "", 'SysListView321', "Select", $G)
        ;Sleep(1000)
Until @error
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-23 21:38 , Processed in 0.137602 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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