无效'exit'语句

VBScript


无效 'exit' 语句

在以下程序控制结构之一中使用了Exit 语句:

  • With 语句。
  • If...Then...Else语句。
  • Select Case语句。

仅在如下结构中可以合法使用Exit 语句来退出:

  • Do...While 循环Exit Do)。
  • For...Next 循环Exit For)。
  • For Each...Next 循环Exit For)。
  • Function 过程(Exit Function)。
  • Sub 过程(Exit Sub)。

要纠正该错误

  • 可能不适当地使用了Exit IfExit With,或Exit Select
  • 不要和IfWithSelect 语句一起使用Exit

请参阅

Exit 语句 | Do...Loop 语句 | For Each...Next 语句 | For...Next 语句 | Function 语句 | Sub 语句