L
Laura Stern
Guest
For the reason I said - the FINALLY block is meant to do clean-up code and the like. It is not meant to override the behavior of the main block. The really obnoxious case is when there is no error condition and the main code does RETURN 10 and the FINALLY block does RETURN 20. We allow that! What the heck does that mean? The ABL will return 20 (the last statement wins). Another case, which is a variation of the one in this post is that there is an untrapped error in the main block (i.e., it is not caught). And then the FINALLY statement does RETURN 10. Well, if you wanted to ignore the error, why didn't you catch it or use NO-ERROR? Just returning a good value from the FINALLY when an error happened that you didn't handle is a very bad coding practice. In C#, for example, they do not allow return statements in finally blocks to avoid all of this confusion.
Continue reading...
Continue reading...