Current Page:
NeXtMidas Training
Macros - Part 1 (Basics)
Loops and Control Structures
Loops
Summary
|
|
- Loop Summary:
Loop |
Syntax |
Comparable Java Loop |
In X-Midas? |
DO |
DO i start end inc
...
ENDDO |
for(int i=start; i<=end; i+=inc) {
...
} |
No |
LOOP |
(NeXtMidas 2.5.0 and later)
LOOP end i
...
ENDLOOP
|
for(int i=1; i<=end; i++) {
...
} |
Yes |
WHILE |
WHILE <test case>
...
ENDWHILE |
while(<test case>) {
...
} |
Yes |
FOREACH |
FOREACH key inTable table
...
ENDFOR |
(Java 5 and later*)
for(String key : table.getKeys()) {
...
} |
No |
FORALL |
forall #=start:end;inc ... |
for(int i=start; i<=end; i+=inc) {
...
} |
Yes |
* As of NeXtMidas 2.3.0, NeXtMidas is still
compatible with Java 1.4.2 and does not use any of the new
Java 5 features. It is likely that NeXtMidas 2.5.0 will
be the first version of NeXtMidas to require Java 5 or later.
|
Java Experts Take Note: |
NeXtMidas does not have a loop that directly matches the (infrequently-used)
do...while loop found in Java.
|
|
|
|