do...Until的问题,请大家帮忙看啊可能[感谢版主pcbar]
我想当没有TSingVision.exe的时候退出自身.有则继续loing().
大家看这样写有什么问题吗?
我运行发现无法退出自己.....
因为程序TSingVision.exe有不少地方要Login()
所以只能循环直到用户关闭
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")
Do
login()
$S1=ProcessExists ("TSingVision.exe")
Until $S1 = ("0")
Exit
Func login()
WinWait("DVR 用户验证","")
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc
[ 本帖最后由 l4ever 于 2008-8-5 01:31 编辑 ] While 1
$S1 = ProcessExists("TSingVision.exe")
If $S1 = 0 Then
ExitLoop
Else
login ()
EndIf
WEnd run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")
Do
login()
Until ProcessExists ("TSingVision.exe") = 0
Exit
Func login()
WinWait("DVR 用户验证","")
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc 谢谢LS两位,可是进程TSingVision.exe没有了,程序还不推出去 Until Not ProcessExists ("TSingVision.exe") 试试
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")
Do
login()
$S1=ProcessExists ("TSingVision.exe")
Until $S1 = ("0")
Exit
Func login()
WinWait("DVR 用户验证",3)
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc 回LS两位,还是不行. Do
ConsoleWrite("1")
Until ProcessExists("notepad.exe") = 0
试试可行 没有tsingvision程序,无法测试,请再试
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")
Do
login()
Until not ProcessExists ("TSingVision.exe")
Exit
Func login()
if WinWait("DVR","",5)=0 then Return
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc
[ 本帖最后由 pcbar 于 2008-8-4 20:10 编辑 ]
页:
[1]