找回密码
 加入
搜索
查看: 1828|回复: 3

[AU3基础] 怎么终止Func循环?

[复制链接]
发表于 2013-12-9 21:06:39 | 显示全部楼层 |阅读模式
本帖最后由 傻娃 于 2013-12-9 21:09 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 117, 88, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 16, 8, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 16, 48, 75, 25)
GUISetState(@SW_SHOW)


While 1
     $nMsg = GUIGetMsg()
     Switch $nMsg
        Case $GUI_EVENT_CLOSE
               Exit
        Case $Button1
               uu()
        Case $Button2
             ;怎么用这个按钮关闭上面这个循环?
     EndSwitch
WEnd

Func uu()
     MsgBox(0,0,'...')
     uu()
EndFunc
怎么停止这个Func循环??
发表于 2013-12-10 09:56:58 | 显示全部楼层
你写的就是一个死循环。
要加一个判断满足你的要求退出。
发表于 2013-12-12 12:01:06 | 显示全部楼层
你可以在这个循环中加一个条件,
比如
Func uu()
if a= 1 then
MsgBox(0,0,'...')
endif
EndFunc

Case $Button1
a  = 1


顺道说下你这个循环方式写错了!
AdlibRegister("uu",100)
你可以试下这个!! 我就不说的太细了!!
发表于 2013-12-12 12:05:09 | 显示全部楼层
顺道说下!!!别用msgbox做循环的提示,很容易卡住的!!用tip就好了!!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-8-27 18:09 , Processed in 0.091299 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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