找回密码
 加入
搜索
查看: 1330|回复: 4

这里or为什么不能用了?

[复制链接]
发表于 2008-11-23 23:30:30 | 显示全部楼层 |阅读模式
Do
        $msgname = InputBox("test", "请输入(数字)", "", " M15", 1, 1, @DesktopWidth / 2 - 95, @DesktopHeight / 2 - 72)
Until StringIsDigit($msgname) Or @error=1

msgbox(0,"",$msgname)

我的目的是,显示一个输入框,当用户输入数字,或者点击取消按钮时退出循环,但是不行...为什么?

现在的情况是只有输入数字才能退出循环,点取消无法退出。

[ 本帖最后由 itljl 于 2008-11-24 17:47 编辑 ]
发表于 2008-11-24 00:28:37 | 显示全部楼层

Do
        $msgname = InputBox("test", "请输入(数字)", "", " M15", 1, 1, @DesktopWidth / 2 - 95, @DesktopHeight / 2 - 72)
                if @error=1 Then ExitLoop
Until StringIsDigit($msgname) 
msgbox(0,"",$msgname)

发表于 2008-11-24 11:52:35 | 显示全部楼层

Do
        $msgname = InputBox("test", "请输入(数字)", "", " M15", 1, 1, @DesktopWidth / 2 - 95, @DesktopHeight / 2 - 72)
Until @error = 1 Or StringIsDigit($msgname)

msgbox(0,"",$msgname)

@error 在后面的会被同一命令行的函数重设了值!
 楼主| 发表于 2008-11-24 17:47:09 | 显示全部楼层
原帖由 liongodmien 于 2008-11-24 11:52 发表
[au3]
Do
        $msgname = InputBox("test", "请输入(数字)", "", " M15", 1, 1, @DesktopWidth / 2 - 95, @DesktopHeight / 2 - 72)
Until @error = 1 Or StringIsDigit($msgname)

msgbox(0,"",$msgname)
...

谢谢,让我明白错误在什么地方了!
 楼主| 发表于 2008-11-24 17:47:31 | 显示全部楼层
原帖由 sanhen 于 2008-11-24 00:28 发表
[au3]
Do
        $msgname = InputBox("test", "请输入(数字)", "", " M15", 1, 1, @DesktopWidth / 2 - 95, @DesktopHeight / 2 - 72)
                if @error=1 Then ExitLoop
Until StringIsDigit($msgname)
msgbox(0 ...

感谢,我想尽可能不用exitloop.不过三楼让我明白原因了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-5 22:32 , Processed in 0.071161 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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