Flow-control structures: Difference between revisions

Content added Content deleted
m (→‎signal: added a comment for LOSTDIGITS condition. -- ~~~~)
m (→‎signal: expanded list of REXXes that support more symbol characters, comment added for signal on/off LOSTDIGITS. -- ~~~~)
Line 1,645: Line 1,645:
The SIGNAL statement can be thought of as a GO TO statement, however, on issuance of a SIGNAL statement, all executing DO loops and SELECTs are terminated. Essentially, that means that there is no real way to re-enter a DO loop once a SIGNAL statement is used.
The SIGNAL statement can be thought of as a GO TO statement, however, on issuance of a SIGNAL statement, all executing DO loops and SELECTs are terminated. Essentially, that means that there is no real way to re-enter a DO loop once a SIGNAL statement is used.


Once a SIGNAL statement is executed, control passed to the first occurance of the label specified (more than one label with the same name isn't considered an error). The label can be any combination of letters, digits, periods, and some special symbols, the most common are $, #, @, !, ?, and _ (underscore or underbar). Some versions of REXX (CMS, TSO, R4) also allow the cent sign (¢).
Once a SIGNAL statement is executed, control passed to the first occurance of the label specified (more than one label with the same name isn't considered an error). The label can be any combination of letters, digits, periods, and some special symbols, the most common are '''$''', '''#''', '''@''', '''!''', '''?''', and '''_''' (underscore or underbar). Some versions of REXX (CMS, PC/REXX, Personal REXX, TSO, R4, ROO) also allow the cent sign ('''¢'''), some of those REXXes support the British pound (currency) symbol ('''£''').


The SIGNAL statement is also used to transfer control in case of some specific conditions:
The SIGNAL statement is also used to transfer control in case of some specific conditions:
Line 1,658: Line 1,658:
signal on failure
signal on failure
signal on halt
signal on halt
signal on lostdigits
signal on lostdigits /*newer REXXes.*/
signal on notready
signal on notready
signal on novalue
signal on novalue
Line 1,666: Line 1,666:
signal off failure
signal off failure
signal off halt
signal off halt
signal off lostdigits
signal off lostdigits /*newer REXXes.*/
signal off notready
signal off notready
signal off novalue
signal off novalue