next up previous index
Next: TYPE: Evaluate/Print Arithmetic Expressions Up: Variables, Arithmetic Expressions, & Previous: Arithmetic Expressions in VISTA   Index

SET: Define a VISTA Variable and Assign it a Value


\begin{command}
\item[\textbf{Form: } SET var\_name=value {[var\_name=value]}\h...
...{the name of the variable being defined.}
\item[value]{its value}
\end{command}

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:
\begin{example}
\item[SET Q=6\hfill]{Sets Q to have the value 6}
\item[SET A=1...
...OG10{[@FILE.1]}\hfill]{References to data from files may be used.}
\end{example}

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:
\begin{example}
\item[A=5\hfill]{defines A to be 5}
\item[Q=SIND{[45]}\hfill]{defines A to be sine of 45 degrees.}
\end{example}


next up previous index
Next: TYPE: Evaluate/Print Arithmetic Expressions Up: Variables, Arithmetic Expressions, & Previous: Arithmetic Expressions in VISTA   Index
Jon Holtzman 2002-02-13