>Is the original error handler set using ON ERROR? If so, you can use Josh's suggestion in the following manner:
>
>PROCEDURE MyFunction
>LOCAL cErrorHandler
>cErrorHandler=ON("ERROR")
>ON ERROR DO newhandler
>.
>.
>IF !EMPTY(cErrorHandler)
> ON ERROR &cErrorHandler
>ENDIF
>RETURN
>
>
Careful there. this routine will leave the temporary error handler in place if there was no previous handler.
You don't need to check for EMPTY, because issuing ON ERROR with no arguments clears the error handler, just like it was before, so will be safe issuing
ON ERROR &cErrorHandler
whether or not there is anything in the variable.
Erik Moore
Clientelligence