Paul Kislanko - 2020-06-18

In bug #548 there was interest in including a rexxtry exec in the Regina package. The original REXXTRY EXEC just contained:

DO FOREVER
   PULL X
   INTERPRET X
 END

or something like that. Seriously that's all it was.

After I discovered Regina, having seen "(deprecated)" in any and all sentences regarding the INTERPRET instruction it occurred to me to just use interactive trace to accomplish the same thing.

My "poor man's rexxtry" is just a

 TRACE '?i'
trace: /* enter rexx clauses */

with the DO FOREVER replaced by a SIGNAL STARTOVER. Wrapped around that are the usual SIGNAL ON error traps, which all end with the same SIGNAL STARTOVER.

I use it two different ways. If I need to do a quick-and-dirty script, I compose it in notepad and just paste it in as input to this exec. For a trivial example:

bits = ''; do 64; bits = bits||random(0,1);end; say bits

My other use is to just copy it into a new file whenever I embark on creating a 'permanent' exec: it already has the error trap code and I just delete everything between the STARTOVER: label and the first SIGNAL STARTOVER and put the new code there.