Loops/Nested: Difference between revisions

no edit summary
No edit summary
Line 1,767:
end
print(exitable())</lang>
 
=={{header|M2000 Interpreter}}==
We can use a number as a label, so instead of using "then goto there" we can use "then 1000" if label is 1000.
 
No numeric labels may have only comments in same line.
 
Numeric labels may have 1 to 5 digits, including leading zeros. So 00010 is label 10. Numeric labels have no : after, but if we place one then this isn't fault, because : is a statement separator.
 
In this example we execute nested for two times, using a third for.
 
 
<lang M2000 Interpreter>
Module Checkit {
Dim A(10,10)<<Random(1, 20)
For k=1 to 2 {
For i=0 to 9 {
For j=0 to 9 {
Print A(i,j)
if A(i,j)=20 then goto there
}
}
there:
Print "...ok", k
}
}
Checkit
</lang>
 
 
=={{header|Maple}}==
Anonymous user