- Form: SET var_name=value [var_name=value]
-
- var_name
- the name of the variable being defined.
- value
- its value
SET defines VISTA variables in terms of numerical constants, other
variables, or the result of arithmetic operations between other
variables. The name of a VISTA variable is any alphanumeric string. The
value of the variable is a floating point number. VISTA supports an
internal variable table which holds variables defined by you or as the
output of a program. These variables can be used to pass the results of
arithmetic calculations to keywords, to control the flow of a procedure in
IF tests or DO loops, or to store convenient numbers in symbolic form.
Each SET command can handle up to 15 definitions. Each definition must
include an '=' sign with the name of the new variable to its left, and a
defining expression to its right. The expression on the right may be any
proper VISTA arithmetic expression (see the section MATH for rules on
expressions).
Examples:
- SET Q=6
- Sets Q to have the value 6
- SET A=1 B=3 C=D=6
- Sets several variables at once
- SET V=SIND[45]
- Functions may be used
- SET B=3.141592600.5+4
- Any arithmetic expression may be used.
- SET C=LOG10[@FILE.1]
- References to data from files may be used.
NOTE: All operations are done in double precision floating point. There
must be no spaces between the beginning of 'var_name' and the end of
'value'.
IMPORTANT!
The command SET may be left off when defining variables. This saves lots
of time. Just use an arithmetic expression defining a variable. Examples:
- A=5
- defines A to be 5
- Q=SIND[45]
- defines A to be sine of 45 degrees.