Solved

Globaly trap errors without ON ERROR GOTO

Posted on 2008-06-12
3
662 Views
Last Modified: 2013-11-26
Is there any way of trapping the global error object in VB6 (ERR) without having to include a on ON ERROR GOTO statement in each procedure/function? When an error occurs I want it to be referred to my own error handling object? Can this be done with the limited OOP function that VB has?
0
Comment
Question by:whittinga2
[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 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 21768279
There is no global errorhandler in vb6

Because Visual Basic nests routines into local address space, all errors happen locally. An unhandled error in some routine that might be handled above that routine, in another error handler, should be considered unhandled because it will probably destabilize the application.

For more information:
http://www.brainbell.com/tutors/Visual_Basic/Tip_5_Have_an_error_handler_in_every_routine.htm
0
 

Author Comment

by:whittinga2
ID: 21768311
Good read - thanks!
0
 
LVL 10

Expert Comment

by:peetm
ID: 21768362
The original paper referred to is here: http://www.charteris.com/publications/white_papers/downloads/OnErrorGoto.pdf

It also formed part of MS-Press' Advanced VB5/6 books.



0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 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