;~ 编写一个程序,它使用3个用户自定义函数(包括main()),并生成下面的输出:
;~ Three blind mice
;~ Three blind mice
;~ See how they run
;~ See how they run
;~ 其中一个函数要掉用两次,改函数生成前两行;了一个函数也被调用两次,办事处呢个其余的输出。
Global $y = 2
$Form1 = GUICreate("练习",200,150,-1,-1)
$button = GUICtrlCreateButton("确定",60,130,30,20)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $button
main()
EndSwitch
wend
Func main()
yi()
yi()
er()
er()
endfunc
Func yi()
GUICtrlCreateLabel("Three blind mice",5,$y)
$y += 20
endfunc
Func er()
GUICtrlCreateLabel("See how they run",5,$y)
$y += 20
endfunc
|