Jump to content

Flow-control structures: Difference between revisions

m
→‎signal: expanded list of REXXes that support more symbol characters, comment added for signal on/off LOSTDIGITS. -- ~~~~
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:
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, 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:
Line 1,658:
signal on failure
signal on halt
signal on lostdigits /*newer REXXes.*/
signal on notready
signal on novalue
Line 1,666:
signal off failure
signal off halt
signal off lostdigits /*newer REXXes.*/
signal off notready
signal off novalue
Cookies help us deliver our services. By using our services, you agree to our use of cookies.