I am putting more and more entire programs into libraries so they can be called from multiple places. Those programs either have built-in error-handling routines or else they call ANOTHER library to do that. Most of my error-handling routines have options to exit the program and chain back to the menu when an error can't be successfully handled any other way.
This is the scenario:
- a. I call a library (which may call another library, which calls another, etc.)
b. I get an error in one of those nested libraries
c. I chain directly out to a menu instead of retracing my steps backwards (via the FNEND which in my mind I equate to a RETURN in a GOSUB)
Are there stack issues or other ramifications to watch out for? I'm envisioning this sort of like nested gosubs that ultimately use a GOTO to exit, rather than navigating the RETURN statements by keeping track of the error information and handling it when I finally arrive back to my starting point.
It's sure a lot easier to handle an error in a nested library by being able to ABORT back to the menu. But is there a downside?