Loops/Foreach: Difference between revisions

Content deleted Content added
Moved NS-HUBASIC, VBA, VBScript to existing BASIC section
Moved Gambas to existing BASIC section
Line 383: Line 383:
<pre>
<pre>
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
</pre>

=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=cb94500c68749f6f93915f3f10de5a03 Click this link to run this code]'''
<lang gambas>Public Sub Main()
Dim siInput As Short[] = [1, 8, 0, 6, 4, 7, 3, 2, 5, 9]
Dim siTemp As Short

For Each siTemp In siInput.Sort()
Print siTemp;;
Next

End</lang>
{{out}}
<pre>
0 1 2 3 4 5 6 7 8 9
</pre>
</pre>


Line 1,094: Line 1,110:


List.iter (fun i -> printfn "%d" i) [1 .. 10]</lang>
List.iter (fun i -> printfn "%d" i) [1 .. 10]</lang>

=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=cb94500c68749f6f93915f3f10de5a03 Click this link to run this code]'''
<lang gambas>Public Sub Main()
Dim siInput As Short[] = [1, 8, 0, 6, 4, 7, 3, 2, 5, 9]
Dim siTemp As Short

For Each siTemp In siInput.Sort()
Print siTemp;;
Next

End</lang>
Output:
<pre>
0 1 2 3 4 5 6 7 8 9
</pre>


=={{header|GAP}}==
=={{header|GAP}}==