|
I've found that it works better when the main procedure's only job is to control the flow of the program, and the subprocedure's jobs are to carry out steps that the program takes, and then return the results to the main procedure.
Plus, this provides source visibility in the main procedure for viewing what happens or doesn't happen in the called procedure, and is therefore a much easier maintenance task. I almost never have ended a program from within a subroutine.
If it's a situtation where something like the shut-down flags, it seems to me that almost any procedure should provide a pretty quick enough return to the caller procedure, and a little bit of coding could take care of exceptions.
Note that I also set on *INLR at the very start of my program. You aren't using the cycle, are you? If not, then why bother ever having *INLR turned off? By setting it on at the top of my calcs, I can end the program with one line of code -- just the RETURN statement.
This comment was one of those moments where I bang my fist on my head and say Why didn't I think of that years ago?!! Thanks!
-- Alan
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.