找回密码
 加入
搜索
查看: 1119|回复: 0

编程练习03

[复制链接]
发表于 2012-5-2 13:03:33 | 显示全部楼层 |阅读模式
;~ 编写一个程序,它使用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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-29 14:31 , Processed in 0.073343 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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