Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Loops-Continue/M2000-Interpreter/loops-continue.m2000
Normal file
36
Task/Loops-Continue/M2000-Interpreter/loops-continue.m2000
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
Module Checkit {
|
||||
\\ A For {} loop
|
||||
For i=1 to 10 {
|
||||
Print i;
|
||||
if i mod 5 Else Print : continue
|
||||
Print ",";
|
||||
}
|
||||
Print i=11
|
||||
\\ A For Next loop
|
||||
For i=1 to 10
|
||||
Print i;
|
||||
if i mod 5 Else Print : continue
|
||||
Print ",";
|
||||
Next i
|
||||
Print i=11
|
||||
\\ A for loop using a block and a Loop statement
|
||||
i=0
|
||||
{ i++
|
||||
if i>10 then Exit
|
||||
loop
|
||||
Print i;
|
||||
if i mod 5 Else Print : continue
|
||||
Print ",";
|
||||
}
|
||||
Print i=11
|
||||
\\ as above but end value for i=10 not 11
|
||||
i=0
|
||||
{ i++
|
||||
if i<10 then loop
|
||||
Print i;
|
||||
if i mod 5 Else Print : continue
|
||||
Print ",";
|
||||
}
|
||||
Print i=10 ' not 11 but 10
|
||||
}
|
||||
Checkit
|
||||
Loading…
Add table
Add a link
Reference in a new issue