General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2003 Server
>Hi Gang!
>
>question.... I have, in some old code, a routine that may or may not have an ON ERROR error handler activated when starting the code.
>
>Any way to save what the rest of the ON ERROR part is, to a variable, at that point? Any function that tells what the ON ERROR part is?
>
>Then, I can change the ON ERROR handler to be what I want it to be and run my new code....
>
>And if the user changes their mind and exits the routine without running my new part, it can restore back whatever the ON ERROR was to begin with, just like nothing has happened.
>
>Thanks!
One other thing to supplement the info from others -- An Error() trap in an object (if it is within the call stack) will take precedence over ON ERROR (at least as far as VFP6 -- hadn't tested if this is also true in VFP7,8 or 9). For example, if you've got an Error event defined in a form, you'll discover that that the form's Error() will trigger instead of the ON ERROR that is defined within the PRG that is called by a form's method. I first got bitten by this when adapting some old FPW code to VFP and used some ActiveX controls as part of the update (namely the Common Dialog control -- as the built-in GETFILE()/PUTFILE() in VFP6 had the limitation of not being able to navigate with UNC paths, and when using the Common Dialog control, you have to have an Error trap to handle some conditions -- otherwise you get a runtime error).
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only