Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtaining environment info when Error occurs
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Obtaining environment info when Error occurs
Miscellaneous
Thread ID:
00341839
Message ID:
00341839
Views:
52
Hi,

I am building some error trapping/handling into my app. I'm already using the following code in the startup program of my app to give me basic information about the error:

*****************

ON ERROR DO errhand WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
CLEAR
oCUWS.Apperror = "PROGRAM ERROR DETAILS"+chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + 'Error number: ' + LTRIM(STR(merror))+chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + 'Error message: ' + mess +chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + 'Line of code with error: ' + mess1 +chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + 'Line number of error: ' + LTRIM(STR(mlineno)) +chr(13)+chr(10)
oCUWS.Apperror = oCUWS.Apperror + 'Program with error: ' + mprog

DO FORM pERROR

*****************

Tha above part works fine. What I'd also like to retrieve are all the open tables/cursors and all the memory variables and current application object properties when the error happens. Any ideas?
Al Williams

Anola MB, CANADA
Next
Reply
Map
View

Click here to load this message in the networking platform