I see what you're saying. I guess I was used to .Net, which ran the Catch (think of putting out fires) before Finally (leaving and closing the barn door).stevedee wrote: ↑Wednesday 30th October 2019 3:04pm Steve, I think the problem is your "Finally" says "Return..". so that's what it is doing.
You would normally use Finally to do stuff like close files or destroy objects, but you are saying "whatever happens, return something" so the code does not reach Catch. Does that make sense?
If an error occurs, you don't really want to return anything because the value will probably be wrong. But if you must return a value its better to do something like this:-
...routine Return x Finally Close files Catch report error Return x
Since a function had to return something, I made sure that there was only one place where it did so.