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

请帮忙解释一下

[复制链接]
发表于 2009-5-18 23:14:22 | 显示全部楼层 |阅读模式
本帖最后由 最上世纪 于 2009-5-19 23:25 编辑

在一位老师写的代码里看到了ContinueCase这个词,在帮助内,在教程里,都没有找到翻译过来的解释,实在没办法,又来麻烦各位老师,ContinueCase的具体意思,和它的作用,还有在什么情况下使用,请说的直观一些,学生基础很薄.谢谢各位老师
发表于 2009-5-19 01:48:08 | 显示全部楼层
select和switch的流程是 case 条件成立后 运行 完 case下面一段就跳到 endselect或者endswitch
而其他case 就不管了
当ContinueCase了 就继续看下一个case 是否成立
发表于 2009-5-19 02:44:14 | 显示全部楼层
本帖最后由 autoit3CN 于 2009-5-19 02:46 编辑

ContinueCase
------------------------------------------------------------------------
Abort the current case and continue a case into the next case in a Select or Switch block.
终止目前的case,并继续到下一个已选择的case
------------------------------------------------------------------------
Normally in a Select or Switch block, a case ends when the next Case statement is encountered. Executing the ContinueCase will tell AutoIt to stop executing the current case and start executing the next case.
Trying to execute ContinueCase outside of a Select or Switch will cause a fatal error.
通常在一个判断或Switch事件,一个判断结束时,下一个判断语句继续。执行ContinueCase会告诉AutoIt停止执行目前的情况下,并开始执行下一个案件。试图执行ContinueCase之外的判断或Switch事件将导致致命错误

运用例子:
$msg = ""
$szName = InputBox(Default, "请输入任意字母", "", " M", Default, Default, Default, Default, 10)
Switch @error
Case 2
    $msg = "超时"
    ContinueCase
Case 1;继续之前的判断
    $msg &= "并准备取消退出";如果你长时间不输入他会显示‘超时并准备取消退出’
Case 0
    Switch $szName
    Case "a", "e", "i", "o", "u"
        $msg = "你输入的是元音"
    Case "QP"
        $msg = "数学"
    Case "Q" to "QZ"
        $msg = "科学"
    Case Else
        $msg = "其他"
    EndSwitch
Case Else
    $msg = "运行出错"
EndSwitch

MsgBox(0, Default, $msg)[/
不是严格翻译,大概意思你可意会不可言传
------------------------------------------------------------------------
相关的还有continueloop【继续一个 While/Do/For 循环】,ExitLoop 【终止一个 While/Do/For 循环】
 楼主| 发表于 2009-5-19 23:24:47 | 显示全部楼层
谢谢两位老师的帮助,说的请清楚.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-10 18:33 , Processed in 0.074060 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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