Previous Next        Current Page: NeXtMidas Training / Macros - Part 1 (Basics) / Loops and Control Structures / IF / Tests
back
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   
WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • The IF statement:
    • Each version of IF performs a test of some type. Common tests include:
      <num> EQ <num> Numeric equality
      <num> NE <num> Numeric inequality
      <num> EQT <num> Numeric equality (with tolerance)
      <num> LT <num> Numeric less than
      <num> GT <num> Numeric greater than
      <str> EQS <str> String equality
      <str> EQSS <str> String equality (to length of shorter string)
      <str> isTrue  String is a true value (Not in X-Midas)
      <str> isFalse  String is a false value (Not in X-Midas)
      <obj> OEQ <obj> Object equality (Not in X-Midas)
      <file> FEQ <file> File equality (Not in X-Midas)
      A test can be negated by prefixing it with an "N".
      A complete list of tests is in the explain file for IF.
NeXtMidas IF command supports C/C++/Java Style Logical Tests (i.e. <, <=, ==, !=, >=,>). See explain file for more details.
X-Midas Users Take Note:
X-Midas uses Fortran strings which are padded out with spaces. Because of this, X-Midas can not compare trailing spaces (e.g. "A" and "A      " look the same to X-Midas). NeXtMidas uses Java strings which are able to check trailing spaces; this causes the string tests to behave a bit differently between NeXtMidas and X-Midas.

back