by Jason Stracner (3 Submissions)
Category: Coding Standards
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating:
(6 Votes)

This code automatically adds centralized error trapping to your code. It reads an .ini file that it stores in the same folder as your project that contains two pieces of code. One is inserted into the top of every method and one is inserted in the bottom. This can be used as a last line of defense against unexpected errors. The default is to allow the user to Abort/Retry/Ignore the error instead of just crashing the program. It will also (optionally) automatically insert line number into your code so that you can use vb's Erl function to get the exact line number where your error occurred.
WARNING: This program directly modifies your code! Be sure to backup your code before using it. I am totally not responsible for any damage to your code.
Credit:
This was adapted from the program 'Auto Error Handler' by Nathan Dennis.