Loops/For with a specified step: Difference between revisions

Content added Content deleted
(Added Chipmunk Basic, GW-BASIC, Minimal BASIC, MSX Basic QBasic, Quite BASIC and Tiny BASIC)
(add RPL)
Line 2,408: Line 2,408:
</pre>
</pre>


=={{header|RPL}}==
Specific increment is given as an argument to the <code>STEP</code> instruction at the end of each loop. Usually, it is a constant value, but it could be a variable if it makes sense.
≪ 1 10 '''FOR''' j
j
2 '''STEP'''
=={{header|Ruby}}==
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">2.step(8,2) {|n| print "#{n}, "}
<syntaxhighlight lang="ruby">2.step(8,2) {|n| print "#{n}, "}