E
eBob.com
Nevermind why, but I recently ran the following simple program, in the
Debugger.
Option Strict On
Option Explicit On
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim somearray() As Integer
'Try
somearray(4) = 4
somearray(7) = 7
For Each Int As Integer In somearray
MsgBox("int is " & Int)
Next
'Catch ex As Exception
' MsgBox(ex.ToString)
'End Try
End Sub
End Class
Without the Try/Catch (note that it is commented out), I never saw the
MsgBoxes, never saw anything about an exception, but did see my (completely
blank, as it should have been) Form1.
It's been my experience, and my research indicates, that unhandled
exceptions are always reported. There IS an exception because the Try/Catch
does catch it.
If I put a breakpoint on the Load handler Sub and step through statement by
statement, when I step to the next statement following the somearray(4)=4
the Debugger quits and I see my Form1.
Is this a bug?
I'm using VBE 2008 with .NET 3.5 SP1 on Vista x64.
Thanks, Bob
Debugger.
Option Strict On
Option Explicit On
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim somearray() As Integer
'Try
somearray(4) = 4
somearray(7) = 7
For Each Int As Integer In somearray
MsgBox("int is " & Int)
Next
'Catch ex As Exception
' MsgBox(ex.ToString)
'End Try
End Sub
End Class
Without the Try/Catch (note that it is commented out), I never saw the
MsgBoxes, never saw anything about an exception, but did see my (completely
blank, as it should have been) Form1.
It's been my experience, and my research indicates, that unhandled
exceptions are always reported. There IS an exception because the Try/Catch
does catch it.
If I put a breakpoint on the Load handler Sub and step through statement by
statement, when I step to the next statement following the somearray(4)=4
the Debugger quits and I see my Form1.
Is this a bug?
I'm using VBE 2008 with .NET 3.5 SP1 on Vista x64.
Thanks, Bob