lin6163 发表于 2008-12-31 19:26:27

求goto 转换

#NoTrayIcon
:aa
Run("Desk.exe")
Sleep(5000)
$i = WinExists ( "Thief Soft(抓*软件)" )
当这个窗口存在时
ProcessClose ( "Desk.exe" )并goto到 aa
当WinExists ( "Thief Soft(抓*软件)" )
这个窗口不存在时退出

akmm88 发表于 2008-12-31 20:06:26

f()
Func f()
   Run("Desk.exe")
   Sleep(5000)
   If WinExists ( "Thief Soft(抓*软件)" ) Then
            ProcessClose ( "Desk.exe" )
            f()
    EndIf
EndFunc
这样应该可以吧,goto语句很多语言都不再支持的。

大绯狼 发表于 2008-12-31 20:07:12

用循环加ContinueLoop

liongodmien 发表于 2008-12-31 20:55:13

求goto 转换
#NoTrayIcon
:aa
Run("Desk.exe")
Sleep(5000)
$i = WinExists ( "Thief Soft(抓*软件)" )
当这个窗口存在时
ProcessClose ( "Desk.exe" )并goto到 aa
当WinExists ( "Thief Soft(抓*软件)" )
这个窗口不存在时退出
按楼主给出的代码和所要求的:

#NoTrayIcon
Run("Desk.exe")
Sleep(5000)
WinWait( "Thief Soft(抓*软件)" )
ProcessClose ( "Desk.exe" )


[ 本帖最后由 liongodmien 于 2008-12-31 20:56 编辑 ]

大绯狼 发表于 2008-12-31 22:10:07

原帖由 liongodmien 于 2008-12-31 20:55 发表 http://www.autoitx.com/images/common/back.gif

按楼主给出的代码和所要求的:

#NoTrayIcon
Run("Desk.exe")
Sleep(5000)
WinWait( "Thief Soft(抓*软件)" )
ProcessClose ( "Desk.exe" )


:face (32):

akmm88 发表于 2009-1-1 11:23:07

原帖由 liongodmien 于 2008-12-31 20:55 发表 http://www.autoitx.com/images/common/back.gif

按楼主给出的代码和所要求的:

#NoTrayIcon
Run("Desk.exe")
Sleep(5000)
WinWait( "Thief Soft(抓*软件)" )
ProcessClose ( "Desk.exe" )


明显不对,我给的那个至少功能上是正确的。
楼主的要求是,winexist延迟5秒,判断这个窗口标题存在,如果不存在就向下执行,反之返回到run()继续

xinda 发表于 2009-1-1 18:35:03

#NoTrayIcon

Do
    Run("Desk.exe")
    Sleep(5000)
    If WinExists... Then ProcessClose...
Until WinExists...=0

lin6163 发表于 2009-1-2 18:58:58

越来越离谱了undefined undefined :face (3): :face (3):

xinda 发表于 2009-1-2 22:48:56

#NoTrayIcon

Do
RunWait ("Control.exe intl.cpl")
Sleep(5000)
If WinExists("无标题 - 记事本") Then ProcessClose ( "rundll32.exe" )
Until WinExists("无标题 - 记事本") = 0原帖由 lin6163 于 2009-1-2 18:58 发表 http://www.autoitx.com/images/common/back.gif
越来越离谱了undefined undefined

怎么会未定义呢???
给你一个实例............
.....................但是我想你的思路是不是犯了逻辑性错误因为你要GOTO到aa,那么就会不停的Run Desk

xinda 发表于 2009-1-2 22:54:59

并且启动时无论有没有检测到窗口都会打开Desk
我也不知道你做什么用,只是按你的描述写咯

zxcbnm 发表于 2009-1-2 23:45:33

undefined undefined

undefined undefined
是回复主题时,楼主删掉了部分字符,呵呵

onestone01 发表于 2009-8-23 12:10:58

怎么看怎么觉得goto好用。期待goto回归的一天。

sensel 发表于 2009-8-23 17:43:59

#NoTrayIcon
While 1
        Run("Desk.exe")
        Sleep(5000)
        If NOT WinExists("Thief Soft(抓*软件)") Then ExitLoop
        ProcessClose("Desk.exe")
WEnd
页: [1]
查看完整版本: 求goto 转换