HOME GUIDE OPERATIONS DOCS FAQ TECHNIQUES FORMATS INSTALL NEW TIPS WEB LINKS Wadsworth Labs

VAR - Variable Assignment

(07/11/09)

PURPOSE

Assign values to Register (Numeric) or Symbolic (String) variables.

SEE ALSO

FR L [Read (sets) a local string (symbolic) variable]
FR G [Read (sets) a global string (symbolic) variable]
FR LS [Sets local string variable using current string values]
FR GS [Sets global string variable using current string values]
RR G [Read Register variables - Global]

USAGE

.OPERATION: [varname] = number
   <or>
[varname] = 'chars'
   <or>
[varname] = [old-varname]
   <or>
[varname] = 'opt-chars'[varname]'opt-chars'
   <or>
GLOBAL [varname] = 'chars'
   <or>
GLOBAL [varname] = number

[Where:
    [varname] is a numerical (register) or string (symbolic) variable name ([]brackets are necessary) which will be assigned a value.

    'chars' is a character string to be associated with the string (symbolic) variable (quotes are necessary).

    number is a numerical value to be associated with the numerical (register) variable.

    [old-varname] is the name of an existing numerical (register) or string (symbolic) variable ([] brackets are necessary).

    'opt-chars' is an optional character string to be become part of the string (symbolic) variable.

    GLOBAL is an optional flag indicating that the variable is visable in all procedures following its definition.

    A 'chars' or 'opt-chars' can have embedded blanks or double (") quotes.

    Anything within a 'chars' is evaluated (bound) only when the string is used.

    Anything within a [old-varname] not surrounded by quotes is evaluated when variable is created (NOT used).

Some typical examples:

   [str_variable] = 'filename'
   [str_variable] = 'img{***[reg-variable]}'
   [str_variable] = 'img[old-str-variable]'
   [str_variable] = 'IMG{***[old-str-variable]}'
   [str_variable] = [old-str-variable]
   global [str_variable] = 'filename'
   GLOBAL [str_variable] = 'filename'

   [reg_variable] = 10
   [reg_variable] = 45.7*32
   [reg_variable] = -1.5678E-02
   GLOBAL [reg_variable] = -2.567

Some more complex examples:

   [new_variable] = '[old-str-variable]dat'
   [new_variable] = [old-str-variable]'.dat'
   [new_variable] = 'IMG'[old-str-variable]
   [new_variable] = 'IMG'{***[old-reg-variable]}'

SUBROUTINES

SYMPAR, SETSYMPAR, SUBSYMPAR, GETNEXTTOKEN

CALLER

SPIDER

© Copyright Notice /       Enquiries: spider@wadsworth.org