Loops/For with a specified step: Difference between revisions
m
Move FutureBasic entry to correct alpha locaction
m (Move FutureBasic out of BASIC group) |
m (Move FutureBasic entry to correct alpha locaction) |
||
Line 622:
Print
Sleep</syntaxhighlight>
==={{header|FutureBasic}}===▼
<syntaxhighlight lang="futurebasic">▼
include "ConsoleWindow"▼
dim as Str15 s(11)▼
dim as long i▼
s(0) = "Somewhere"▼
s(2) = " over"▼
s(4) = " the"▼
s(6) = " rainbow" + chr$(13)▼
s(8) = "Bluebirds"▼
s(10) = " fly."▼
for i = 0 to 10 step 2▼
print s(i);▼
next</syntaxhighlight>▼
{{out}}▼
<pre>Somewhere over the rainbow▼
Bluebirds fly.</pre>▼
==={{header|Gambas}}===
Line 1,444 ⟶ 1,423:
</syntaxhighlight>
▲<syntaxhighlight lang="futurebasic">
▲include "ConsoleWindow"
▲dim as Str15 s(11)
▲dim as long i
▲s(0) = "Somewhere"
▲s(2) = " over"
▲s(4) = " the"
▲s(6) = " rainbow" + chr$(13)
▲s(8) = "Bluebirds"
▲s(10) = " fly."
▲for i = 0 to 10 step 2
▲print s(i);
▲next</syntaxhighlight>
▲{{out}}
▲<pre>Somewhere over the rainbow
▲Bluebirds fly.</pre>
=={{header|GML}}==
<syntaxhighlight lang="gml">for(i = 0; i < 10; i += 2)
|