Anonymous user
Scope/Function names and labels: Difference between revisions
m
→{{header|REXX}}: added/changed comments and whitespace, changed indentations.
m (added whitespace before the TOC, added a Task (bold) header.) |
m (→{{header|REXX}}: added/changed comments and whitespace, changed indentations.) |
||
Line 462:
<br>(all of the above are normally contained on one line (record), but may (syntactically) be continued by the normal REXX rules for continuation.
<br><br>Any label can be referenced from anywhere in the REXX program (global scope).
<br><br>Multiple labels (with the same name) are not considered an error in the REXX language; the first label found (topmost) is used.
<lang rexx>/*REXX program demonstrates the use of labels and also a CALL statement. */
signal do_add /*transfer program control to a
ttt = sinD(30) /*this REXX statement is never executed
/* [↓] Note the case doesn't matter.
say 'calling the sub: add.2.args'
call add.2.args 1, 7 /*pass two arguments: 1 and a 7
say 'sum =' result /*display the result from the function.*/
exit /*stick a fork in it,
/*──────────────────────────────────────────────────────────────────────────────────────*/
add.2.args:
▲add.2.args: say 'Whoa Nelly!! Has the universe run amok?'
▲ /* [↑] dead code, never XEQed*/
▲add.2.args: return arg(1) + arg(2) /*concise, but never executed.*/</lang>
'''output'''
<pre>
|