<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=IF</id>
	<title>IF - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ice-online.com/index.php?action=history&amp;feed=atom&amp;title=IF"/>
	<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=IF&amp;action=history"/>
	<updated>2026-04-11T11:14:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.ice-online.com/index.php?title=IF&amp;diff=794&amp;oldid=prev</id>
		<title>ConvertBot: implements a logical block if-then-else function in a macro</title>
		<link rel="alternate" type="text/html" href="https://wiki.ice-online.com/index.php?title=IF&amp;diff=794&amp;oldid=prev"/>
		<updated>2020-04-27T22:04:59Z</updated>

		<summary type="html">&lt;p&gt;implements a logical block if-then-else function in a macro&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;implements a logical block if-then-else function in a macro&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VALUE&amp;gt; Left side of expression&lt;br /&gt;
&amp;lt;TEST&amp;gt;  Logical test to be performed.&lt;br /&gt;
&amp;lt;VALUE&amp;gt; Right side of expression&lt;br /&gt;
&lt;br /&gt;
There are two forms of the IF statement; both can only be used in a macro.&lt;br /&gt;
The first form is the block IF, the second is the one-line IF.&lt;br /&gt;
&lt;br /&gt;
Block IF Statement:&lt;br /&gt;
  The block IF statement evaluates a logical expression and, if the logical&lt;br /&gt;
  expression is true, executes the set of statements following. If the logical&lt;br /&gt;
  expression is false, control transfers to the next ELSE, ELSEIF, or ENDIF&lt;br /&gt;
  statement at the same IF level. The syntax is as follows (optional items are&lt;br /&gt;
  in braces):&lt;br /&gt;
&lt;br /&gt;
    IF &amp;lt;conditional&amp;gt; THEN&lt;br /&gt;
      &amp;lt;action&amp;gt;&lt;br /&gt;
    [ELSEIF &amp;lt;conditional&amp;gt; THEN&lt;br /&gt;
      &amp;lt;action&amp;gt;&lt;br /&gt;
    ]&lt;br /&gt;
    [ELSE&lt;br /&gt;
      &amp;lt;action&amp;gt;&lt;br /&gt;
    ]&lt;br /&gt;
    ENDIF&lt;br /&gt;
&lt;br /&gt;
  IF-ELSEIF-ELSEIF-...-ELSE-ENDIF blocks can be nested without limit. Note that&lt;br /&gt;
  &amp;quot;THEN&amp;quot; is technically optional, but highly recommended.&lt;br /&gt;
&lt;br /&gt;
One-Line IF Statement:&lt;br /&gt;
  The one-line IF requires that the &amp;lt;action&amp;gt; be a single executable Midas&lt;br /&gt;
  command, such as GOTO, BREAK, ENDMODE, CALC, etc.  It should not be the start&lt;br /&gt;
  or end of a structure (such as WHILE,ENDWHILE,LOOP,ENDLOOP,IF,ENDIF,etc), or&lt;br /&gt;
  an operating system command.  For those, the block IF should be used.&lt;br /&gt;
&lt;br /&gt;
    IF &amp;lt;conditional&amp;gt; THEN &amp;lt;action&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Prior releases indicated that the THEN was optional for the one-line IF;&lt;br /&gt;
  this is not always the case. Since NeXtMidas 2.1.2 the THEN is required for&lt;br /&gt;
  one-line IF statements.&lt;br /&gt;
&lt;br /&gt;
  WARNING: When using a one-line IF statement the &amp;lt;action&amp;gt; may be cleaned (i.e.&lt;br /&gt;
           converted to uppercase) before execution. If this is a problem, use&lt;br /&gt;
           the multi-line IF syntax.&lt;br /&gt;
&lt;br /&gt;
Conditional Expressions:&lt;br /&gt;
  A &amp;lt;conditional&amp;gt; expression has the following form:&lt;br /&gt;
    &amp;lt;value1&amp;gt; &amp;lt;test1&amp;gt; &amp;lt;value2&amp;gt; [ &amp;lt;conjunction&amp;gt; &amp;lt;value3&amp;gt; &amp;lt;test2&amp;gt; &amp;lt;value4&amp;gt; ... ]&lt;br /&gt;
&lt;br /&gt;
  where &amp;lt;conjunction&amp;gt; is either AND or OR.&lt;br /&gt;
&lt;br /&gt;
Tests:&lt;br /&gt;
   A EQ B         Numeric A is   equal   to B&lt;br /&gt;
   A == B         Numeric A is   equal   to B (since 2.5.0)&lt;br /&gt;
   A NE B         Numeric A is not equal to B&lt;br /&gt;
   A != B         Numeric A is not equal to B (since 2.5.0)&lt;br /&gt;
   A GT B         Numeric A is greater than B&lt;br /&gt;
   A &amp;gt;  B         Numeric A is greater than B (since 2.5.0)&lt;br /&gt;
   A LT B         Numeric A is   less  than B&lt;br /&gt;
   A &amp;lt;  B         Numeric A is   less  than B (since 2.5.0)&lt;br /&gt;
   A GE B         Numeric A is greater or equal to B&lt;br /&gt;
   A &amp;gt;= B         Numeric A is greater or equal to B (since 2.5.0)&lt;br /&gt;
   A LE B         Numeric A is   less  or equal to B&lt;br /&gt;
   A &amp;lt;= B         Numeric A is   less  or equal to B (since 2.5.0)&lt;br /&gt;
&lt;br /&gt;
   A EQT B        Alias for EQ/T, see below for details.&lt;br /&gt;
   A ~= B         Alias for EQ/T, see below for details. (since 2.5.0)&lt;br /&gt;
   A EQTOL B      Old alias for EQ/T (rarely used any more).&lt;br /&gt;
&lt;br /&gt;
                  ***********************************************************&lt;br /&gt;
                  * Note: Prior to NeXtMidas 3.3.2 the above tests assumed  *&lt;br /&gt;
                  * scalar input values and only considered the first part  *&lt;br /&gt;
                  * of any non-scalar input. This behavior was deprecated   *&lt;br /&gt;
                  * in NeXtMidas 2.7.0 and removed in NeXtMidas 3.3.2. Now  *&lt;br /&gt;
                  * all entries in a non-scalar value are considered.       *&lt;br /&gt;
                  ***********************************************************&lt;br /&gt;
&lt;br /&gt;
                  **************************************************************&lt;br /&gt;
                  * The following test modifiers for EQ can be combined (e.g.  *&lt;br /&gt;
                  * &amp;quot;A EQ/M/T B&amp;quot; compare magnitude of A and B with a tolerance.*&lt;br /&gt;
                  **************************************************************&lt;br /&gt;
&lt;br /&gt;
   A EQ/S B       Makes sure both have the same number of elements (size). This&lt;br /&gt;
                   is almost always combined with /M or /V.&lt;br /&gt;
   A EQ/B B       Use a binary data comparison. Use with caution since this&lt;br /&gt;
                    will return false if even the slightest thing is different&lt;br /&gt;
                    (e.g. &amp;quot;1 EQ/B 1.0&amp;quot; -- which compares a L: to a D: will fail)&lt;br /&gt;
   A EQ/T B       Numeric A is equal to B within tolerance.&lt;br /&gt;
                    By default this will use a relative tolerance check using&lt;br /&gt;
                    the system-wide tolerance (usually 1e-6). This can be&lt;br /&gt;
                    overridden using the following switches:&lt;br /&gt;
                      /TOL=&amp;lt;tol&amp;gt;   - Use *relative* tolerance &amp;lt;tol&amp;gt;&lt;br /&gt;
                      /DELTA=&amp;lt;tol&amp;gt; - Use *absolute* tolerance &amp;lt;tol&amp;gt; (since 3.3)&lt;br /&gt;
                    See nxm.sys.libm.Tolerance for more info on &amp;quot;relative&amp;quot;.&lt;br /&gt;
   A EQ/M B       Compare the magnitude of the values of each atom&lt;br /&gt;
                    (refer to nxm.sys.lib.Data.getMagnitude()).&lt;br /&gt;
   A EQ/V B       Compare each value in an atom one-by-one. This is the same as&lt;br /&gt;
                    computing vector equality in Euclidean space.&lt;br /&gt;
   A NE/? B       Same as NEQ/? where ? is any valid modifier(s) for EQ.&lt;br /&gt;
&lt;br /&gt;
   A GT/M B       Numeric A has greater magnitude than B&lt;br /&gt;
   A LT/M B       Numeric A has less    magnitude than B&lt;br /&gt;
   A GE/M B       Numeric A has greater or equal magnitude than B&lt;br /&gt;
   A LE/M B       Numeric A has less    or equal magnitude than B&lt;br /&gt;
&lt;br /&gt;
   A ANYBITS B    Integer A contains any of the bits set in integer B&lt;br /&gt;
   A ALLBITS B    Integer A contains all of the bits set in integer B&lt;br /&gt;
&lt;br /&gt;
                  ***********************************************************&lt;br /&gt;
                  * Note: String tests ignore case unless /CS is present!   *&lt;br /&gt;
                  ***********************************************************&lt;br /&gt;
&lt;br /&gt;
   A ENDS B       A ends with B.  TRUE if A ends with all the characters in B.&lt;br /&gt;
                    This is same as A.endsWith(B).      (Since NeXtMidas 3.1.2)&lt;br /&gt;
   A EQS  B       String A equal to string B in length and content&lt;br /&gt;
   A EQSS B       EQual Shortest String: Equality is checked only up to the&lt;br /&gt;
                    length of the shorter of A or B&lt;br /&gt;
   A SEQS B       String A equal to String B (alias for EQS)&lt;br /&gt;
   A STARTS B     A starts with B.  TRUE if A starts with all the chars in B.&lt;br /&gt;
                    This is same as A.startsWith(B).    (Since NeXtMidas 3.5.0)&lt;br /&gt;
   A SUBS B       A is a substring of B.  TRUE if all the characters of A are&lt;br /&gt;
                    found in their entirety and in order somewhere within B.&lt;br /&gt;
&lt;br /&gt;
   A FEXISTS      The file named A exists (note that the file existence tests&lt;br /&gt;
                    can be customized in the case of a URL, see javadocs for&lt;br /&gt;
                    HttpResource for more info).&lt;br /&gt;
   A DEXISTS      The directory named A exists&lt;br /&gt;
   A REXISTS      The results parameter named A exists&lt;br /&gt;
   A PEXISTS      The parameter or switch named A or /A exists for this macro&lt;br /&gt;
&lt;br /&gt;
   A ISNULL       The object A is NULL or does not exist&lt;br /&gt;
   A ISTRUE       The state of A resolves to true. [This is the DEFAULT test.]&lt;br /&gt;
                  (TRUE states include: Y|YES|T|TRUE|ON|1|PASS|SUCCESS|ABSC|AB)&lt;br /&gt;
   A ISFALSE      The state of A resolves to false&lt;br /&gt;
                   (FALSE states include: N|NO|F|FALSE|OFF|0|FAIL|INDEX|IN)&lt;br /&gt;
&lt;br /&gt;
   A FEQ   B      File A is equal to File B (same as FEQ/H/D/S, files must be&lt;br /&gt;
                    equal in size)&lt;br /&gt;
   A FEQ/B B      File A is equal to File B - BINARY comparison&lt;br /&gt;
   A FEQ/D B      File A DATA is equal to File B DATA&lt;br /&gt;
   A FEQ/H B      File A HEADER is equal to File B HEADER&lt;br /&gt;
   A FEQ/K B      File A *extended* header KEYWORDS are equal to File B extended&lt;br /&gt;
                    header KEYWORDS.&lt;br /&gt;
   A FEQ/L B      File A is equal to File B (limits length of binary or data&lt;br /&gt;
                    comparison to size of shorter file, when applicable)&lt;br /&gt;
                                                         (Since NeXtMidas 3.7.0)&lt;br /&gt;
   A FEQ/S B      File A is equal in size to File B&lt;br /&gt;
   A FEQ/T B      File A is equal within *relative* tolerance to File B.&lt;br /&gt;
                    See notes about /TOL=&amp;lt;tol&amp;gt; with IF/T (above).&lt;br /&gt;
&lt;br /&gt;
   A OEQ  B       Object A is equal to Object B&lt;br /&gt;
&lt;br /&gt;
   A TYPEOF     B The result A matches the type specified in B (see below).&lt;br /&gt;
   A INSTANCEOF B The result A is an instance of class B (see below).&lt;br /&gt;
   A CONTAINS   B This is the same as CONTAINS/K test.&lt;br /&gt;
   A CONTAINS/K B The table A contains the key B (String). -or-&lt;br /&gt;
                  Since 3.5.4, the Map A contains the key B (any Object).&lt;br /&gt;
                  FALSE if A is not a java.util.Map. Table is a Map.&lt;br /&gt;
                  Since 3.5.4, supports /CS switch to do a case-sensitive key B&lt;br /&gt;
                  containment check on the Table.&lt;br /&gt;
                  NOTE: Key B containment on Map that is NOT a table, always&lt;br /&gt;
                  does an Object check (and hence it is case-sensitive).&lt;br /&gt;
   A CONTAINS/V B The Map/Table A contains the value B (via Object.equals).&lt;br /&gt;
                  FALSE if A is not a java.util.Map.     (Since NeXtMidas 3.5.4)&lt;br /&gt;
&lt;br /&gt;
  Putting an &amp;quot;N&amp;quot; on the beginning of any test (except for the &amp;quot;C-style&amp;quot; numeric&lt;br /&gt;
  tests) will test for its logical opposite, for example:&lt;br /&gt;
&lt;br /&gt;
   A NEQS B       String A does not equal B&lt;br /&gt;
   A NEQ  B       Numeric A is not equal to B (same as NE)&lt;br /&gt;
   A NFEQ B       The files differ&lt;br /&gt;
   A N&amp;lt;   B       Not allowed&lt;br /&gt;
&lt;br /&gt;
  If the &amp;lt;test&amp;gt; is omitted, the ISTRUE state test is assumed.&lt;br /&gt;
&lt;br /&gt;
  Note that ANDs and ORs are short-circuiting; as soon as a condition is&lt;br /&gt;
  evaluated which can stop evaluation, evaluation will stop.&lt;br /&gt;
&lt;br /&gt;
TYPEOF vs INSTANCEOF:&lt;br /&gt;
  INSTANCEOF matches the Java instanceof operator. The right-hand-argument is&lt;br /&gt;
  always the (case sensitive) name of a class or interface. The test will&lt;br /&gt;
  return true for &amp;quot;a INSTANCEOF b&amp;quot; if...&lt;br /&gt;
    (1) The class of a is the same as b&lt;br /&gt;
    (2) The class of a is a subclass of b&lt;br /&gt;
    (3) The class of a is a implements of b where b is an interface&lt;br /&gt;
&lt;br /&gt;
  Due to this &amp;quot;a INSTANCEOF java.lang.Object&amp;quot; will always return true since&lt;br /&gt;
  all objects are subclasses of java.lang.Object.&lt;br /&gt;
&lt;br /&gt;
  TYPEOF has two sets of functionality. The first takes in the name of a&lt;br /&gt;
  Java class as the right-hand-argument and checks to see if the class&lt;br /&gt;
  is an *exact* match. In this form, &amp;quot;a TYPEOF b&amp;quot; maps to the Java code&lt;br /&gt;
  a.getClass().getName().equalsIgnoreCase(b). The second form takes in the&lt;br /&gt;
  name of a Midas format type (e.g. 'D'=double,'F'=float,...) or digraph (e.g.&lt;br /&gt;
  &amp;quot;SF&amp;quot;=ScalarFloat,&amp;quot;VD&amp;quot;=VectorDouble,&amp;quot;3D&amp;quot;=ThreeDouble). This test will return&lt;br /&gt;
  true for &amp;quot;a TYPEOF b&amp;quot;: if...&lt;br /&gt;
    (1) The class of a is the same as b (ignoring the case of b)&lt;br /&gt;
    (2) The class of a is String and b is &amp;quot;S&amp;quot; (special case)&lt;br /&gt;
    (3) The class of a is Data and the type of a matches b where b is a&lt;br /&gt;
        single-letter type specifier&lt;br /&gt;
    (4) The class of a is Data and the format digraph of a matches b where&lt;br /&gt;
        b is a two-letter format digraph (note that this does an &amp;quot;exactness&amp;quot;&lt;br /&gt;
        check where &amp;quot;VD&amp;quot; is *not* the same as &amp;quot;3D&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  Due to this &amp;quot;a TYPEOF b&amp;quot; will always return false when b is the name of an&lt;br /&gt;
  interface or abstract class since it is doing an exactness check.&lt;br /&gt;
&lt;br /&gt;
Precedence Rules:&lt;br /&gt;
  The precedence rules is LEFT to RIGHT between conjunctions (AND|OR).&lt;br /&gt;
  Additionally, the logical test will short-circuit when an OR conjunction is&lt;br /&gt;
  used and the result is TRUE on the LEFT side, hence all tests to the right&lt;br /&gt;
  of the OR conjunction will be ignored and not processed.&lt;br /&gt;
  The test will also short-circuit when an AND conjunction is used and the&lt;br /&gt;
  result is FALSE on the LEFT side, hence all tests to the right of the AND&lt;br /&gt;
  conjunction will be ignored and not processed.&lt;br /&gt;
&lt;br /&gt;
  IF 1 LT 2  OR   2 GT 3   AND 3 EQ 4  ! TRUE  (all tests after OR  are skipped)&lt;br /&gt;
  IF 1 EQ 2 AND &amp;quot;A&amp;quot; EQ &amp;quot;B&amp;quot;  OR 3 EQ 3  ! FALSE (all tests after AND are skipped)&lt;br /&gt;
&lt;br /&gt;
  Current versions of NeXtMidas permit parenthesis around the test cases which&lt;br /&gt;
  give more control over the precedence.&lt;br /&gt;
&lt;br /&gt;
    IF ( (1 LT 2) OR (2 GT 3)  AND (3 EQ 4))  ! TRUE&lt;br /&gt;
    IF (((1 LT 2) OR (2 GT 3)) AND (3 EQ 4))  ! FALSE&lt;br /&gt;
&lt;br /&gt;
String Rules:&lt;br /&gt;
  The following rules apply to the string comparisons (SUBS,EQSS,EQS,etc.):&lt;br /&gt;
    - String tests are Case Insensitive unless the /CS switch is used.&lt;br /&gt;
    - Length of a string literal is the number of characters between the quotes.&lt;br /&gt;
    - Trailing spaces are not trimmed.&lt;br /&gt;
    - If an argument to a string test is a switch name and that switch is not&lt;br /&gt;
      present the string will contain the text &amp;quot;NULL&amp;quot; and can be tested&lt;br /&gt;
      appropriately.&lt;br /&gt;
&lt;br /&gt;
    WARNING: The results of EQS, EQSS and SUBS comparisons are different from&lt;br /&gt;
             X-Midas, since X-Midas treats &amp;quot;&amp;quot; and &amp;quot; &amp;quot; as being equal, NeXtMidas&lt;br /&gt;
             does not do this.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
  Numeric Tests:&lt;br /&gt;
    Given that D1=D:1.0, D2=D:1.00001, L1=L:1&lt;br /&gt;
      IF D1 EQ   D2           ! FALSE (Different numbers)&lt;br /&gt;
      IF D1 EQ   L1           ! TRUE  (Same numbers)&lt;br /&gt;
      IF D1 EQ/B L1           ! FALSE (Different bits for D: vs L:)&lt;br /&gt;
      IF D1 EQT  D2           ! FALSE (use default  tolerance, normally 1e-6)&lt;br /&gt;
      IF D1 EQT  D2 /TOL=1e-5 ! TRUE  (use relative tolerance of 1e-5)&lt;br /&gt;
&lt;br /&gt;
      IF 100 EQ/T 99.95     /TOL=1e-6        ! FALSE (relative tolerance)&lt;br /&gt;
      IF 100 EQ/T 99.999999 /TOL=1e-6        ! TRUE  (relative tolerance)&lt;br /&gt;
      IF 100 EQ/T 99.95     /DELTA=0.2       ! TRUE  (absolute tolerance)&lt;br /&gt;
      IF 100 EQ/T 99.999999 /DELTA=0.0000002 ! FALSE (absolute tolerance)&lt;br /&gt;
&lt;br /&gt;
  String Tests:&lt;br /&gt;
    Given that LS is the MAX of LA and LB.  A EQS B is TRUE if LA equals LB and&lt;br /&gt;
    all characters of both strings are the same.&lt;br /&gt;
      RESULTS A:S1 &amp;quot;A &amp;quot;      ! S1 has length 2&lt;br /&gt;
      RESULTS A:S2 &amp;quot; &amp;quot;       ! S2 has length 1&lt;br /&gt;
&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   EQS  &amp;quot;A &amp;quot;     ! FALSE (Different lengths)&lt;br /&gt;
      IF &amp;quot;aBc&amp;quot; EQS  &amp;quot;ABC&amp;quot;    ! TRUE  (defaults to non-case sensitive comparison)&lt;br /&gt;
      IF &amp;quot;AA&amp;quot;  EQS  &amp;quot;aa&amp;quot; /CS ! FALSE (case sensitive comparison)&lt;br /&gt;
      IF &amp;quot; &amp;quot;   EQS  &amp;quot;&amp;quot;       ! FALSE (empty string and blank are different!)&lt;br /&gt;
      IF &amp;quot;&amp;quot;    EQS  &amp;quot;A&amp;quot;      ! FALSE (&amp;quot;&amp;quot; does not equal &amp;quot;A&amp;quot;)&lt;br /&gt;
      IF S1    EQS  &amp;quot;A&amp;quot;      ! FALSE&lt;br /&gt;
      IF S1    EQS  &amp;quot;A &amp;quot;     ! TRUE&lt;br /&gt;
      IF S2    EQS  &amp;quot;&amp;quot;       ! FALSE (empty string and blank are different!)&lt;br /&gt;
      IF S2    EQS  &amp;quot; &amp;quot;      ! TRUE&lt;br /&gt;
      IF S2    EQS  &amp;quot;A&amp;quot;      ! FALSE&lt;br /&gt;
&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   EQSS &amp;quot;A &amp;quot;     ! TRUE  (the first chars are the same)&lt;br /&gt;
      IF &amp;quot;A &amp;quot;  EQSS &amp;quot;A&amp;quot;      ! TRUE  (same as above, order is not important)&lt;br /&gt;
      IF S1    EQSS &amp;quot;A   &amp;quot;   ! TRUE  (same as above)&lt;br /&gt;
      IF &amp;quot; &amp;quot;   EQSS &amp;quot;&amp;quot;       ! TRUE  (empty string is EQSS with any string)&lt;br /&gt;
      IF &amp;quot;ABC&amp;quot; EQSS &amp;quot;&amp;quot;       ! TRUE  (same as above)&lt;br /&gt;
      IF S2    EQSS &amp;quot;ABC&amp;quot;    ! FALSE (S2 starts with a ' ')&lt;br /&gt;
      IF S1    EQSS S2       ! FALSE (S2 starts with a ' ')&lt;br /&gt;
      IF &amp;quot;A &amp;quot;  EQSS &amp;quot; A&amp;quot;     ! FALSE (leading space is important)&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   EQSS &amp;quot; A&amp;quot;     ! FALSE (leading space is important)&lt;br /&gt;
      IF &amp;quot;AB&amp;quot;  EQSS &amp;quot;BAB&amp;quot;    ! FALSE (first 2 characters not the same)&lt;br /&gt;
      IF &amp;quot;A &amp;quot;  EQSS &amp;quot;AB &amp;quot;    ! FALSE (first 2 characters not the same)&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   EQSS &amp;quot;AB&amp;quot;     ! TRUE  (first character is the same)&lt;br /&gt;
      IF &amp;quot; AB&amp;quot; EQSS &amp;quot; &amp;quot;      ! TRUE&lt;br /&gt;
&lt;br /&gt;
      IF &amp;quot;ABC&amp;quot; STARTS &amp;quot;A&amp;quot;    ! TRUE (First string starts with &amp;quot;A&amp;quot;)&lt;br /&gt;
      IF &amp;quot;Abc&amp;quot; STARTS &amp;quot;b&amp;quot;    ! FALSE&lt;br /&gt;
      IF &amp;quot;Abc&amp;quot; STARTS &amp;quot;a&amp;quot; /CS! FALSE (Fails case sensitive starts with check.)&lt;br /&gt;
&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   SUBS &amp;quot;A &amp;quot;     ! TRUE  (&amp;quot;A&amp;quot; found in the first character)&lt;br /&gt;
      IF &amp;quot;A&amp;quot;   SUBS &amp;quot;BCDA&amp;quot;   ! TRUE  (&amp;quot;A&amp;quot; found at the 4th character)&lt;br /&gt;
      IF S1    SUBS &amp;quot;A&amp;quot;      ! FALSE&lt;br /&gt;
      IF &amp;quot;^S1&amp;quot; SUBS &amp;quot;A&amp;quot;      ! FALSE&lt;br /&gt;
      IF &amp;quot;A &amp;quot;  SUBS &amp;quot;A&amp;quot;      ! FALSE&lt;br /&gt;
      IF &amp;quot;A &amp;quot;  SUBS &amp;quot;CA B&amp;quot;   ! TRUE  (&amp;quot;A &amp;quot; found at the second character)&lt;br /&gt;
      IF &amp;quot; &amp;quot;   SUBS &amp;quot;&amp;quot;       ! FALSE (no space at all on right hand side)&lt;br /&gt;
      IF S1    SUBS S2       ! FALSE (no leading string &amp;quot;A&amp;quot; in an empty string)&lt;br /&gt;
      IF S2    SUBS S1       ! TRUE&lt;br /&gt;
      IF &amp;quot;BCD&amp;quot; SUBS &amp;quot;ABCDE&amp;quot;  ! TRUE&lt;br /&gt;
&lt;br /&gt;
      Invoking methods on a java.lang.String results to do comparisons.&lt;br /&gt;
      IF &amp;quot;&amp;quot;.isEmpty()        ! ERROR (not supported at this time)&lt;br /&gt;
      IF S1.isEmpty()        ! FALSE&lt;br /&gt;
      IF S1.contains(&amp;quot;A&amp;quot;)    ! TRUE  (same as &amp;quot;A&amp;quot; SUBS S1)&lt;br /&gt;
      IF S1.contains(&amp;quot;a&amp;quot;)    ! FALSE (since 3.5.0 lower case passed correctly)&lt;br /&gt;
      IF S1.contains(s2)     ! TRUE  (same as S2 SUBS S1)&lt;br /&gt;
      IF S1.matches(&amp;quot;A.&amp;quot;)    ! TRUE  (using regex - 'A' followed by any char)&lt;br /&gt;
      IF S1.matches(&amp;quot;A*&amp;quot;)    ! FALSE (using regex - zero or more 'A's)&lt;br /&gt;
      IF S1.matches(&amp;quot;A.*&amp;quot;)   ! TRUE  (using regex)&lt;br /&gt;
      IF S1.startsWith(&amp;quot; &amp;quot;,1) ! TRUE (prefix,toffset)&lt;br /&gt;
      IF S1.startsWith(&amp;quot;A&amp;quot;,1) ! FALSE&lt;br /&gt;
      IF S1.regionMatches(1,&amp;quot;ABC &amp;quot;,3,1) ! TRUE  (toffset,other,ooffset,len)&lt;br /&gt;
      IF S1.regionMatches(1,&amp;quot;ABC &amp;quot;,3,2) ! FALSE (len does not match)&lt;br /&gt;
      IF S1.regionMatches(1,S2,0,1)     ! TRUE&lt;br /&gt;
      IF S1.regionMatches(0,&amp;quot;TMA &amp;quot;,2,2) ! TRUE&lt;br /&gt;
      IF S1.regionMatches(0,&amp;quot;Da &amp;quot;,1,1)  ! FALSE (since 3.5.0 lower case 'a')&lt;br /&gt;
      IF S1.regionMatches(true,0,&amp;quot;Da&amp;quot;,1,1) ! TRUE (ignore case)&lt;br /&gt;
&lt;br /&gt;
  File/Directory Tests:&lt;br /&gt;
    Gracefully deletes a Midas file.  Note that this is a one-line IF.&lt;br /&gt;
&lt;br /&gt;
        IF file FEXISTS THEN ERASE file&lt;br /&gt;
&lt;br /&gt;
    Recalculates the maximum of the file &amp;quot;myfile&amp;quot;, if either REDO has been set&lt;br /&gt;
    to 1, or the result &amp;quot;filemax&amp;quot; does NOT exist and the file DOES exist:&lt;br /&gt;
&lt;br /&gt;
        IF redo EQ 1 OR filemax NREXIST AND myfile FEXIST THEN&lt;br /&gt;
          MAXMIN myfile filemax&lt;br /&gt;
        ENDIF&lt;br /&gt;
&lt;br /&gt;
Switches:&lt;br /&gt;
  /CS          - Perform a CASE SENSITIVE test. For EQS, EQSS, ENDS, SEQS,&lt;br /&gt;
                 STARTS, SUBS, and CONTAINS (in Table) only. [DEF=IgnoreCase]&lt;br /&gt;
&lt;br /&gt;
  /DELTA=&amp;lt;tol&amp;gt; - The *absolute* tolerance for the EQ/T, and FEQ/T tests. This&lt;br /&gt;
                 will override any use of /TOL= without warning (this permits&lt;br /&gt;
                 /TOL= to be given at top of macro to override system-wide&lt;br /&gt;
                 relative tolerance without restricting use of /DELTA=). If&lt;br /&gt;
                 /DELTA= is not specified *relative* tolerance checks will be&lt;br /&gt;
                 used. [DEF=&amp;lt;use relative tol&amp;gt;]          (since NeXtMidas 3.3.2)&lt;br /&gt;
&lt;br /&gt;
  /TOL=&amp;lt;tol&amp;gt;   - The *relative* tolerance for the EQ/T, and FEQ/T tests. If not&lt;br /&gt;
                 specified (and /DELTA= is not specified) the system-wide&lt;br /&gt;
                 *relative* tolerance (usually 1e-6) will be used.&lt;br /&gt;
&lt;br /&gt;
SEE ALSO:  ELSE, ELSEIF, ENDIF, nxm.sys.libm.Tolerance, nxm.sys.lib.Args,&lt;br /&gt;
           nxm.sys.lib.Data&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:NXM_Explain]]&lt;/div&gt;</summary>
		<author><name>ConvertBot</name></author>
		
	</entry>
</feed>