Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Loops and Control Structures / Loops / Summary
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
Option Trees   
Macros - Part 1 (Basics)   
   + Macro Basics   
   - Loops and Control Structures   
      - IF   
         - Tests   
         - IF (Block)   
         - IF (One-Line)   
         - IF (Quick Check)   
      - Loops   
         - DO   
         - LOOP   
         - WHILE   
         - FOREACH   
         - BREAK and CONTINUE   
         - FORALL   
         - Summary   
      - GOTO and LABEL   
      - Lab 1 - Macro Control   
         - Instructions   
         - Solution   
      - Lab 2* - Macro Control   
         - Instructions   
         - Solution   
   + Procedures and Subroutines   
   + Pipes in a Macro   
   + Messages in a Macro   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • 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.