RR - Read (Set) Register variables

(8/27/2013)

PURPOSE

To read value(s) into a local register (numerical) variable. Useful to set numerical variables from inside a SPIDER procedure at run time. See 'VAR' operation for alternative methods.   Example.

SEE ALSO

RR G [Read Register variables - Global]
RR C [Read Numeric (Register) variables - Copy from global]
RR S [Read Register variable - from list of variables]
VAR [Variable Assignment]

USAGE

.OPERATION: RR [var1],[var2],[var3],...

WITHIN AN INTERACTIVE SESSION OR WITHIN A PROCEDURE WHERE A ?SOLICITATION PROMPT? DOES NOT FOLLOW THE OPERATION:

RR [var1],[var2],[var3]

.VALUE(S): 4.0, 5, 6

[Enter the floating point value(s) to be put into listed register variables (here: [var1],[var2], and [var3]). In this form the operation is equivalent to the operations '[var1] = 4.', followed by: '[var2] = 5', followed by: '[var3] = 6'. Indeed, it offers no advantage over these simple operations, except that it allows multiple register variables to be set on a single line.
A procedure containing the 'RR' operation NOT followed by a solicitation prompt reads its input from the succeeding line in the same procedure.
The value may either be explicitly entered (e.g. 4.0), declared as the contents of a register variable known to the current procedure (e.g. [var20]), or as a string variable known in the current procedure (e.g. [var_str]).]

QUERY INTERACTIVE INPUT FROM INSIDE A PROCEDURE:

RR [mag],..
? ENTER MAGNIFICATION ?

[A procedure containing the 'RR' operation followed on the next line by a solicitation prompt e.g. ? ENTER MAGNIFICATION ? produces the following prompt in the interactive session]:

? ENTER MAGNIFICATION ? 4.
[The magnification value may either be explicitly entered (e.g. 4.), declared as the contents of a register variable already defined within the interactive session (e.g. [var20]), or as a symbol already defined within the interactive session (e.g. [var_sym]). The value entered in any of the three forms will be stored in register variable: [mag].]

QUERY A CALLING PROCEDURE FROM INSIDE A PROCEDURE, WHERE A SOLICITATION PROMPT FOLLOWS THE OPERATION:

RR [mag],..
? ENTER MAGNIFICATION ?
[A procedure containing the 'RR' operation followed on the next line by a solicitation prompt (e.g. ? ENTER MAGNIFICATION ?) reads its input from the succeeding line in the calling procedure. In the calling procedure the magnification value may either be explicitly entered (e.g. 4.), declared as the contents of a register variable known in the calling procedure (e.g. [var20]), or as a string variable known in the calling procedure (e.g. [var_str]).] The value entered in any of the three forms will be stored in register variable: [mag].]

NOTES

  1. Unless you have used operation 'MD' with option () ON, 'RR' can NO LONGER be used within a DO-loop to enter a set of numbers successively into a register variable. Use 'RR S' instead.

  2. Deprecated legacy usage If you have used the Mode operation 'MD' with option () ON, then operation 'RR' reverts to its legacy usage and can be used within a DO-loop to enter a single set of set of numbers into multiple registers:
    DO I=1,5
      RR [x],[y],[z]
      (4,8,12)
      ~~~
      ~~~
    ENDDO
    In each iteration: [x],[y],[z] will be filled with the same respective values: 4, 8, 12.

    However when the values are not enclosed within ()s, e.g.:
    DO I=1,3
      RR [x]
      4,8,12
      ~~~
      ~~~
    ENDDO
    In each iteration: [x] will be filled with a succeeding value from the list: 4, 8, 12.
    However in this case:
    For iteration =1, [x] will be filled with the value 4 ,
    for iteration =2, [x] will be filled with the value 8 ,
    for iteration =3, [x] will be filled with the value 12
    and so forth.

SUBROUTINES

READRQ, REG_SET, SHRINKQ, CHKSTR

CALLER

DRIV1

© Copyright Notice /       Enquiries: spider@wadsworth.org