IF - Conditional expression execution (Scripting operation)

(12/05/11)

PURPOSE

To allow evaluation of a conditional expression or loop iteration control. (Modeled after the FORTRAN 'IF' statement).   Example.

SEE ALSO

IF_GOTO [Conditional jump (Scripting operation)]
IF_THEN [Conditional execution of operations (Scripting operation)]
DO [Start of a loop (Scripting operation)]
EXIT [Ends execution of current operation loop (Scripting operation)]
CYCLE [Starts next loop iteration (Scripting operation)]

USAGE

.OPERATION: IF ( <EXP> <LC> <EXP> ) <R> = <EXP>
    <or>
IF ( <EXP> <LC> <EXP> ) EXIT
    <or>
IF ( <EXP> <LC> <EXP> ) CYCLE

Where:

  1. <EXP> is an expression
  2. <R> is a register variable.
  3. <LC> is a logical comparator. The following comparators are allowed:
  4. Comparator Alternate Comparision
    .EQ. == Equal to
    .NE. /= Not equal to
    .GT. > Greater than
    .GE. >= Greater than or equal to
    .LT. < Less than
    .LE. <= Less than or equal to

NOTES

  1. Examples:
    IF( [xlen] >= 15 )   [xpad] = 57
    IF( [xlen] .GE. 15 )   [xpad] = 57
    IF( [xlen] < (13-2) )   [resol] = 5.6
    IF( [xlen] < 13 )   CYCLE     (Within a DO loop)

  2. <EXP> does not include setting a string variable e.g the following is NOT ALLOWED.
    [file] = 'img000'  
    IF( [xlen] < 13 )   [file] = 'img001'
Examples:  

SUBROUTINE: LOGIFQ

CALLER:     SPIDER