傻娃 发表于 2013-12-9 21:06:39

怎么终止Func循环?

本帖最后由 傻娃 于 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循环??

fuldho 发表于 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就好了!!
页: [1]
查看完整版本: 怎么终止Func循环?