“错误处理程序”中是否存在“堆栈空间不足”错误?

时间:2012-03-29 13:29:14

标签: vb6 stack-overflow runtime-error

VB6错误处理程序是否会捕获"Out of stack space"错误,还是会导致运行时错误?

1 个答案:

答案 0 :(得分:3)

它将被错误处理程序捕获。

Private Sub Form_Load()
  Count2 0
End Sub

Private Sub Count2(ByVal Value As Long)
  On Error GoTo x
  Count2 Value + 1
  Exit Sub
x:
  MsgBox "stack depth " & Value
  Err.Clear
End Sub

stack depth 3659