So you can add an on-exit section to the end of a procedure, and it will execute code whenever the procedure ends, no matter how it ends, and optionally override the return value. Which is useful.
My question is, is there a way that code running in on-exit can detect what the procedure's return value was?
I know I could define a field in the procedure, set that to the return value, and then always return that field, and have on-exit reference that field. But I was hoping that on-exit would have some predefined access to the return value so I would not need to remember to always ensure the procedure does that.
My question is, is there a way that code running in on-exit can detect what the procedure's return value was?
I know I could define a field in the procedure, set that to the return value, and then always return that field, and have on-exit reference that field. But I was hoping that on-exit would have some predefined access to the return value so I would not need to remember to always ensure the procedure does that.
Comment