Talk:Flow-control structures: Difference between revisions

→‎REXX Return: an example showing all flavors
(→‎REXX Return: extracted from (oo)rexref and simplified)
(→‎REXX Return: an example showing all flavors)
 
Line 51:
to the value of expression. Otherwise the special variable RESULT is dropped.</pre>
--[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 21:01, 17 December 2013 (UTC)
:::::: The following example shows all the flavors (and a surprise when I invoke the program as rexx ret 1 (on Windows using ooRexx)! The control structure seems to get broken)
<lang rexx>Call sub 1
s=sub(2)
Say 's='s
sub: parse Arg a
Select
When a=1 Then Say 'we''ll return to line 2'
When a=2 Then Say 'we''ll return to the expression in line 2'
Otherwise Say 'we''ll exit the program'
End
Return a</lang>
Output:
<pre>we'll return to line 2
we'll return to the expression in line 2
s=2
we'll exit the program</pre>
 
== REXX Exit ==
2,295

edits