Andy Wij

Andy Wij

  • NA
  • 26
  • 35k

Make just in time error handler like on foxpro

Jan 18 2012 10:51 AM
Hello all,

I have some project using c# and I've realize everytime I want to handled an error I need to trap a code inside try-catch block.. I just want to know is there anyway to make some error handler class to catch n display error information everytime error raised even the code is not in the try-catch block?

I'm a foxpro developer too and I found on foxpro I can make some .prg module to display information.. Let I say the name of module is errhand.prg..
so on main.prg(the default exe) will have some code like this..

* ------------------------------
* Main prg to be execute
* ------------------------------

* some code

* this will call errhand.prg each time application have an error
ON ERROR DO errhand with (some parameter)

* to show main form
DO FORM main
READ EVENTS

---------------------------------

only with ON ERROR syntax it's possible on foxpro, Is there any syntax similar on c#? thanks for the help..

Answers (2)