Loops/Foreach: Difference between revisions

→‎{{header|REXX}}: deleted versions not compliant with task description, that is: use a DO .. FOR.. construct. -- ~~~~
m (→‎version 1: made REXX compliant to the task description in using a DO ... FOR ... construct. -- ~~~~)
(→‎{{header|REXX}}: deleted versions not compliant with task description, that is: use a DO .. FOR.. construct. -- ~~~~)
Line 1,030:
 
=={{header|REXX}}==
===version 1===
<lang rexx>days = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
 
Line 1,036 ⟶ 1,035:
say word(days,j)
end /*j*/</lang>
 
===version 2===
<lang rexx>days = "sunday monday tuesday wednesday thursday friday saturday"
hlp = days
 
do while hlp <> ""
parse var hlp item hlp
say item
end</lang>
===version 3===
{{works with|oorexx}}:
<lang rexx>colors = .bag~of("red","green","blue","pink")
 
do c over colors
say c
end</lang>
 
=={{header|Ruby}}==