ContinueCase
中止当前 Case 代码块事件, 继续 Select 或 Switch 结构中的下一个 Case 代码块事件.
ContinueCase
备注
通常在 Select 或 Switch 结构中,当遇到下一个 Case 语句时, 则结束当前 Case 块中的代码.
运行 ContinueCase() 通知 AutoIt 停止当前 Case 代码块的执行, 并开始执行下一个 Case 代码块.
AutoIt 不进行下一个 Case 语句的比较 - 仅运行块内的代码.
试图在 Select 或 Switch 之外执行 ContinueCase() 将导致致命错误.
相关
Select...EndSelect, Switch...EndSwitch
函数示例
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $sName = InputBox("", "Please enter a word.", "", " M", Default, Default, Default, Default, 10)
Local $sMsg = ""
Switch @error
Case 2
$sMsg = "Timeout "
ContinueCase
Case 1 ; Continuing previous case
$sMsg &= "Cancellation"
Case 0
Switch $sName
Case "a", "e", "i", "o", "u"
$sMsg = "Vowel"
Case "QP"
$sMsg = "Mathematics"
Case "Q" To "QZ"
$sMsg = "Science"
Case Else
$sMsg = "Others"
EndSwitch
Case Else
$sMsg = "Something went horribly wrong."
EndSwitch
MsgBox($MB_SYSTEMMODAL, "", $sMsg)
EndFunc ;==>Example
----------------------------------------
|