EXIT - Ends execution of current operation loop (Scripting operation)

(11/11/06)

PURPOSE

Immediately cease current DO Loop iterations. Modeled after the FORTRAN 90 EXIT statement.   Example.

SEE ALSO

IF [Conditional expression execution (Scripting operation)]
IF_THEN [Conditional execution of operations (Scripting operation)]
GOTO [GOTO (Scripting operation)]
DO [Start of a loop (Scripting operation)]

USAGE

.OPERATION: EXIT
<or>

.IF(<EXP>.<LC>.<EXP>) EXIT

[Only usefull inside a 'DO' Loop.]

Where:

  1. <EXP> is an expression
  2. <LC> is a logical comparator. The following comparators are allowed:
  3. EQ Equal
    NE Not equal
    GT Greater
    GE Greater/equal
    LT Less
    LE Less/equal

EXAMPLE:

DO [iter]=1,100
~~~~~~~
~~~~~~~
EXIT
; NEVER USED
; NEVER USED
ENDDO

MORE MEANINGFULL EXAMPLE:

DO [iter]=1,9999
IQ FI [exists]
input{****[iter]
IF ([exists].EQ.0) EXIT
AC
input{****[iter]
output{****[iter]
ENDDO

NOTES

  1. Prior to SPIDER release 15.0, 'DO' loops were terminated with a label operation 'LB'. This label had to be specifed when invoking the loop. This earlier syntax is often found in SPIDER procedures and is still supported but is now deprecated. Example:
    DO LB4 [iter]=1,9999
    IQ FI [exists]
    input{****[iter]
    IF ([exists].EQ.0) GOTO LB5
    AC
    input{****[iter]
    output{****[iter]
    LB4
    LB5

  2. More information on DO-loops.

SUBROUTINES

SPIDER, FINDLBQ, GETLBNO

CALLER

SPIDER