Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error handling...

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I need to learn the basics of error handling:

I have certain types of run-time errors which creep up in my program and I want to deal with them. 99% of the errors are:285, 13 or 53. These can happen in one of many functions.
Is it possible to stick a bit of code somewhere that just looks for errors and gives the user a message box explaining the consequenses of the errors depending on what the error code is.

What I dont want to do, however is to have to put in error handling code into every function and procedure!

Many Thanks

elziko
 
My solutions in that case would be to create a class that you can pass the error details to and then let that class handle the error. If you are sure that what you know is occuring is all that is occuring you can then set this error handler to issue a Resume Next statement. You would need to issue an error handler in the entry procedure for your application/DLL. This is dangerous though, and it is better to add error-handling to every procedure.

James :) James Culshaw
jculshaw@active-data-solutions.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top