Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Loops and Control Structures / Loops / BREAK and CONTINUE
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   


  • The BREAK Command:
    • The BREAK command is used to exit the nearest enclosing WHILE, DO, or FOREACH loop. It functions similarly to the Java break Statement.

      For example, the following loop will exit once it reaches 4:
      do count 1 7 1
        if count EQ 4 then BREAK
        say "The count is at ^count"
      enddo
      
    • See the BREAK explain file for more details.
  • The CONTINUE Command:
    • The CONTINUE command is used to quit the current iteration and starts the next one of the nearest enclosing WHILE, DO, or FOREACH loop. It functions similarly to the Java continue Statement.

      For example, the following loop will skip the SAY when count is 4:
      do count 1 7 1
        if count EQ 4 then CONTINUE
        say "The count is at ^count"
      enddo
      
    • See the CONTINUE explain file for more details.