No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: morphinex {http:#9366410}
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
TheLearnedOne
EE Cleanup Volunteer
Main Topics
Browse All Topics





by: morphinexPosted on 2003-09-15 at 14:46:04ID: 9366410
If you have many different sub procedures that're nested... You could create a custom error and throw it. Here's a quick example..
n
'Create a new class, and throw this in there.
Class YourOwnException
Inherits System.ApplicationExceptio
Overrides ReadOnly Property Message() As String
Get
Return "Unable to continue"
End Get
End Property
End Class
'Now in your form...
Private sub Proc1()
Try
call Proc2()
Catch ex as YourOwnException
Throw
Catch ex as Exception
MsgBox("Other kinds of error occured")
End try
End sub
Private Sub Proc2()
Try
call Proc3()
Catch ex as YourOwnException
Throw
Catch ex as Exception
MsgBox("Other kinds of error occured")
End try
End sub
Private sub Proc3()
Try
'Your code here... if you want to stop...
throw New YourOwnException()
Catch ex as YourOwnException
Throw
End Try
End sub