Try
i = 0 / 0
DoEvenMore
Catch ex As Exception
End Try
If the eval of i creates an error how do I have the Catch block resume
execution at the procedure DoEvenMore?
JW
How about
Try
i = 0 / 0
Catch ex As DivideByZeroException
' i = 0 ?
Finally
DoEvenMore()
End Try
--
diwen
Try
Catch
'no code here. ignore exception.
End Try
DoEvenMore
Don't be surprised if you don't get an exception in this case at all...
Armin
You know, you can do an On Error GoTo and Resume Next, which you'll have to
get rid if the try/catch.
ACK, but you'd have to put each statement in a separate 'Try...Catch' block
in order to receive a behavior similar to those of 'Resume Next'.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
> In VB6 one could use 'Resume Next' to have program execution resume at the
> statement following where an error occurred. Is there something comparable
> in VB .NET?
Yes.
"On Error Resume Next"
Yes, it /still/ works; if you really, /really/ want to.
More likely, though, you'll want to use Try .. Catch ... won't you!?
Sub X()
Try
DoSomethingDodgy()
Catch ex As Exception
' Do Nothing
End Try
DoEvenMore()
End Sub
Unless you [re-]throw the Exception out of the Catch, execution
continues with the next statement /after/ the End Try.
HTH,
Phill W.