Solved

VB.Net: Quitting execution without exiting form

Posted on 2014-01-28
4
274 Views
Last Modified: 2014-01-28
I have a VB.Net application with a deeply embedded routine: about five layers in on the call stack.  If a particular exception occurs at this level, I want to stop execution but keep the form running.  A simple "End" command stops execution and unloads the form; and "Exit Function" takes me out of the offending routine, but it's still operating within a larger loop from which I wish to exit in order to send control back to the form.  I did achieve my objective, creating a ByRef string within my function to provide feedback to the calling program, progressively working to the bottom of the call stack, and exiting cleanly.  I'm looking for an "Exit" command that obviates the need for taking the exotic measures I had to take to dig myself out from the deep hole in which I was.  Does such a command exist?  Thanks, ~Peter Ferber
0
Comment
Question by:PeterFrb
  • 3
4 Comments
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 500 total points
ID: 39815553
A "throw" will take you up to the nearest level that catches it.
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39815558
0
 

Author Closing Comment

by:PeterFrb
ID: 39815609
Indeed, exactly what I needed.  I come from the VBA and VB6 world, and I appreciate learning the nuances of the .Net world.  Thank you.  ~Peter
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39815842
My pleasure.  Welcome to .NET!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now