Solved

VB.Net: Quitting execution without exiting form

Posted on 2014-01-28
4
281 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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