1 IF
   Syntax:   IF expression
              block of statements
             [ELIF expression]
              [block of statements]
             [ELSE]
              [block of statements]
             ENDIF

  This  is  a  rudimentary  conditional  block  structure.  If the
  expression is true, then the first block of statements is performed,
  if it  is  false, then  the  control goes to the block of alternate
  statements following the  `ELSE'. A second block can be started with
  the `ELIF' statement. If  there  is  no  `ELSE'  block,
  execution picks up normally after the `ENDIF'.

  Note the result of an expression is always returned as a floating
  point number, i.e. also the results of `INT' and `NINT' are
  converted back to floating point immediately.

  The `IF' statement can only be used from a command file or in a
  defined command.

  WARNING: In Mn_Fit versions before 4.07/32 you should not include
  comment lines inside `DEFINE' commands, if there is a `DO' loop
  inside the same file. Inline comments are OK.  Mn_Fit keeps track of
  which line is being read for future use in IF blocks and DO
  loops. If you have comment lines inside the DEFINE command, the
  counting of the line number gets out of sync. As a result any DO
  loops that are executed after the definitions (within the same
  macro) will not work properly. After the first run through the loop
  Mn_Fit will rewind the file and then jump to the wrong line for the
  second and future runs through the loop.

2 expression

  The expression can involve registers, parameters, or real numbers.
  At  this  time,  you  are  limited  to  no  more  than four  simple
  logical expressions per `IF' statement, linked by `.AND.' or `.OR.',
  and the whole expression must appear on the  same  line as the `IF'.
  The whole expression may be surrounded by a pair of parentheses, but
  individual expressions within the whole may not.  You should not use
  the word `THEN' after the expression.

2 Examples

!\begin{enumerate}
!\item
!^
    Example 1:
      Here  is  a simple  IF which  decides  whether to use a Maximum
      Likelihood fit or a Chi-square  fit  based  on  the area of the
      histogram:

      SET PL 10 DEFAULT
      IF R125 .LT. 100
        MESSAGE USING MAXIMUM LIKELIHOOD
        FIT 10 1
      ELSE
        MESSAGE CHI-SQUARE
        FIT 10 0
      ENDIF

!\item
!^
    Example 2:
      Here is a rather mundane example which illustrates Nesting of
      IF statements:

      DEFINE BIGGEST
      IF ( @1 .GT. @2 )
        MESSAGE First is biggest
      ELSE
        IF @2 .GT. @1
          MESSAGE Second is biggest
        ELIF @2 .LT. 1
          MESSAGE 'If is screwed up, as this has already been checked'
        ELSE
          MESSAGE They are equal
        ENDIF
      ENDIF
      ENDDEF

!\item
!^
    Example 3:
      This example illustrates linking of conditionals in a single
      IF statement:

      IF ( @1 > @2 & R4 > R6 | R4 .GT. 25 )
        block of statements
      ENDIF

      Conditionals in MN_FIT are evaluated left-to-right, so the above
      would be evaluated as:

           IF (( @1 > @2   &   R4 > R6 ) | ( R4 > 25 ))
      NOT  IF (( @1 > @2 ) & ( R4 > R6   |   R4 > 25 ))

      Notice that you CANNOT use parentheses to overide the order
      of evaluation.  Only ONE set  of  parentheses is allowed - around
      the whole expression - individual  subexpressions  should  not be
      surrounded by parentheses!
!\end{enumerate}

