On Sun, 14 Jan 2018 16:07:24 -0800, Charles Mills wrote: >What's the problem with SIGNAL? > >(I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON >... . I drank the Structured Programming Kool-Aid in the seventies.) > SIGNAL obliterates the active block structure of the current procedure but doesn't exit any procedure.
A naive colleague once used SIGNAL labelname intending to exit a called procedure and return to a label before the main loop on an exceptional condition. Worked fine on test data. In production, it failed as soon as a large enough data set caused enough SIGNALs to overflow the call/return stack on the next iteration. Not easy to fix. Do not branch around the LM; FREEMAIN! I wish that ITERATE controlvariable and LEAVE controlvariable were enhanced to operate on any controlled DO with controlvariable in scope (EXPOSEd) even if the DO were in an enclosing procedure, and exit cleanly any intervening procedures -- a 1970's-structured longjump. ITERATE mainloop would have nicely solved my colleague's problem. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN