Now, this is kind of my personal opinion, but in the spirit of good programming, I really don't like to use exceptions in the normal execution of code. If you need to make sure a variable isn't Nil, then by all means, make sure the variable isn't Nil first. Have you noticed that Exception handlers can be vauge and hard to use at times? Exception handlers are designed to be a last resort to prevent your program from crashing and to at least give you the chance to recover from something you haven't handled.

Personally, I have one exception handler in all my programs - in the App.UnhandledException event, just to keep my programs from simply crashing. Other than that, I make every effort to simply avoid an error before it causes any weirdness. In most cases, it's just adding another enclosing if-statement.

Error checking is something I don't think enough people take seriously. RB makes it a little less painful with having soft crashes, where it will close any binary streams, release memory, and do a few other things if your program really does crash, but the bottom line is, you, as the programmer are the one and only person who has the best opportunity to prevent your program from crashing.

There is no class or plugin that will prevent your program from suffering from any conceivable error. In a way, what you're looking for is RB. By all means, make sure the variable isn't Nil before you use it. Think about all the possible outcomes of your code. Take advantage of layered if-statements (but don't go crazy, either). If you wrote a program that works half the time and throws up Exceptions for the rest, then you're not done. Write code that avoids problems. 99% of the time, it's easier to walk around the can of paint rather than to kick it and then clean up the mess.

- Andrew Keller

On Dec 2, 2006, at 3:12 PM, Claude Stone wrote:

I have found that including an exception statement in each routine will direct me to the routine and then troubleshoot by breakpoints. IE:

Exception
    MsgBox "Unhandled exception error in routine xyz"


At 08:32 AM 12/2/2006, you wrote:
I'm sure that I'm not the only one who finds error trapping a tedious
process. Does anyone know of any classes or plugins that will help take
care of this automatically?

Any input would be appreciated!


RB5.5.5 and a mostly unused copy of 2006r2.
WinXP, 2.2 GHz, 2G RAM

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.15.3/562 - Release Date: 12/1/2006 1:12 PM

Claude Stone

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to