Loops/Nested: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 3,561: | Line 3,561: | ||
dim integer table(ROWS, COLUMNS) |
dim integer table(ROWS, COLUMNS) |
||
rem - populate table using FOR..NEXT loops |
rem - populate table using nested FOR..NEXT loops |
||
for i=1 to ROWS |
for i=1 to ROWS |
||
Line 3,569: | Line 3,569: | ||
next i |
next i |
||
rem - show results using WHILE..DO loops |
rem - show results using nested WHILE..DO loops |
||
i = 1 |
i = 1 |
||
Line 3,586: | Line 3,586: | ||
comment |
comment |
||
Although S- |
Although S-BASIC allows alphanumeric line numbers as the target |
||
of a GOTO or GOSUB statement, the first "digit" must in fact be |
of a GOTO or GOSUB statement, the first "digit" must in fact be |
||
a number. |
a number, as shown here. |
||
end |
end |
||
0done if i > ROWS then print " |
0done if i > ROWS then print "target value"; MAXVAL; " not found!" |
||
end |
end |
||
Line 3,599: | Line 3,599: | ||
1 2 7 20 |
1 2 7 20 |
||
</pre> |
</pre> |
||
=={{header|Scala}}== |
=={{header|Scala}}== |