中斷一個 While/Do/For 循環(huán)。
ExitLoop [循環(huán)層]
參數(shù)
循環(huán)層 | [可選參數(shù)] 中斷(多層嵌套循環(huán)中的)指定層。默認值為 1 (表示當前循環(huán))。 |
注意
如果參數(shù) 循環(huán)層 是負數(shù)或零則無任何作用。
相關(guān)
ContinueLoop, Exit, For, Do, While
示例
$sum = 0
While 1 ;有意設(shè)置的死循環(huán),因為后面有 ExitLoop 語句
$ans = InputBox("總和 = " & $sum, _
" 請輸入一個正數(shù)(輸入負數(shù)則退出):")
If $ans < 0 Then ExitLoop
$sum = $sum + $ans
WEnd
MsgBox(0,"結(jié)果是:", $sum)