C# Process Issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is encountered, therefore i wanted to use ExitSub.

With Regards
Sunny
 
Sunny said:
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is
encountered, therefore i wanted to use ExitSub.


Hi Sunny,

You can use "return". Another option to consider is the "break" statement
if you are in a loop and would like to hop out and exit cleanly at the end
of the method.

Joe
 
You would use a try catch block.
When you encounter an error condition, throw an error, and catch it in the
caller (or anywhere up the call stack)

Sunny said:
Hi,
Does anyone know what is the equivalent of C# "ExitSub", as in VB.
I wanted to stop the processing of my procedure once an Error is
encountered, therefore i wanted to use ExitSub.
 
Back
Top