HOME GUIDE OPERATIONS DOCS ERRORS FORMATS INSTALL NEW TIPS WEB SITES

DO - start of DO loop

(3/19/97)

PURPOSE

This allows the user to set up DO loops in a batch runstream.

USAGE

.OPERATION: DO LB25 I=5,17
[Enter the range and corresponding variable of the DO loop.]

 
          LI                 
          PIC00I 
          1-5 

[Enter the batch runstream.]

LB25 [Enter the label that corresponds to the label in the DO statement.]

The syntax of the DO loop is as follows: DO LB<N> <VAR>=<LOWER>,<UPPER>

LB<N>

Where: 1. N is an integer between 0 and 99 which identifies the label of the DO loop. 2. VAR is the corresponding one-letter variable of the DO loop. (Any letter of the alphabet may be used, unless you plan to use the 'SD' or 'UD' operations, in which case "X" may not be used.) 3. LOWER is a constant that specifies the lower bound of the DO loop, between 1 and 99999. 4. UPPER is a constant that specifies the upper bound of the DO loop, between 1 and 99999.

In the above example, DO will list out to the results file the first 5 rows of the files PIC005 through PIC017.

Note that nesting of DO loops is allowed. For example: DO LB1 I=2,3

DO LB2 J=9,11

LB2

LB1 will perform the operations within the LB2 loop 6 times, and the operations within the LB1 loop 2 times.

Variable Value Input In DO-Loops:

NOTE: IF THIS FEATURE IS NOT TO BE USED, THEN (almost) ALL INPUT VALUES TO EACH OPERATION ARE TO BE ENCLOSED IN PARENTHESES. (exemptions are those operations that ask for a sequence of possibly more than 2 numbers like 'MN' which asks: .ENTER FILE NUMBERS: 1-3,5,8,10 internally in SPIDER the subroutine RDPRAI is used, whereas for single and two-variable input RDPRM,RDPRM2, and RDPRMI are used, which look for parentheses.

The same sequence of operations can be applied with different parameter values to the same image.

For variable parameter input values may be entered in sequence, to be picked according to the DO-loop count. Example:

DO LB1 I=1,3 SH PIC00I OUT00I 4., 5., 2.3, 1.2, -7.1, 8.2 LB1

In this example, 'SH' uses the shift vector (4.,5.) with the picture PIC001, (2.3,1.2) with PIC002, and (-7.1,8.2) with PIC003.

In the case of operations requiring a pair of numbers (e.g., shift coordinates), one pair has to be provided for each run of the DO-loop. However, if the same floating point number or pair of numbers should be used for each run of the DO-loop, this may be specified by using a single number (or pair of numbers) enclosed in parentheses. Example:

DO LB7 I=5,9 SH ALL00I SHI00I (15,8) LB7

In this case, the shift parameter values 15,8 are applied to each image, starting with ALL005 and ending with ALL009.

NOTES

  1. When nesting DO loops, make sure that different letters are used for VAR. In the above example, I and J may both be used in specifying filenames. DO loops may be nested up to a maximum of 10 deep.

  2. DO is a batch only operation.

  3. In the above example, the file ACF00I was specified. The I in the filename corresponds to the I in the DO statement. Thus, when the DO loop is executed, the I in the filename will be changed to the value of I in the DO statement. This allows the user to apply the same operations to several files, without repetition.

  4. The user is limited to 100 DO loops per batch runstream.

  5. Any number of operations may appear between DO and LB#.

  6. Both lower and upper bounds of the DO loop command may be registers. For example:
    DO LB1 I=X10,X11
    is allowed.

SUBROUTINES

SPIDER

CALLER

SPIDER

© Copyright Notice /       Enquiries: spider@wadsworth.org