In your error handler you can use AERROR.
=AERROR(MyErrorArray)
If you are using COM, you might want to look at COMRETURNERROR()
There is a sample in download#
9840>I have a custom class method that gets remote data. If the connection handle that the SPT code uses fails I need to re-establish the connection and rerun the method. I have it almost working except for one problem. I send the PROGRAM() variable to the error code so it can re-execute the method, which says the calling program is pdm_vaiables.getAS400Data, the name of my class is pdm_variables. But the calling program is really pdm_var.getAS400Data. The pdm_var is the global variable set by a NewObject statement. What is the remedy?
Imagination is more important than knowledge