User Tools

Site Tools


jvs:cigal:manual:chapter3:assign

CIGAL Reference Manual, Chapter 3 (Functions): ASSIGN

ASSIGN -- <![CDATA[= (ASSIGN) Copy values into a data variable]]>

usage: variable = expression

        The assignment operator '=' stores data into a variable.  The target may not be a
numerical constant or a quoted character string, but can be any variable type.
EXPRESSION can be a constant, another variable, or an arithmetic expression. The type
and size of the variables involved determine the number of values transferred
during the assignment.

The result of an assignment operation is the value that has been assigned. This means
that (like in the C language) an assignment can be used as an operand in its own right,
in another arithmetic operation.  For example, the single command:
                         rotate vecs a=3+b
is the same as the 2 lines:
                         a=3+b
                         rotate vecs a
or you could write:
                         a = (b = (c = 0))
(In the last example the parentheses are needed to force evaluation from right to left.)

Note: When an assignment is the first operator on a command line, the value of the
operation is not printed, as would be the case for any other operator.  This is
done on the assumption that you don't really want to see the results of every
assignment operation.  Thus, the expressions A=3+B and 3+B are treated exactly
the same when they appear as command arguments as in:
                        scale vecs a=3+b
and:                    scale vecs 3+b
but they are treated somewhat differently when they stand alone, because
the sum will be printed for:           3+b
but not for:                           a=3+b

See Also:
ARITHMETIC(1), VARIABLES(1)

CIGAL Home, CIGAL Manual, Functions List, Manual Help

jvs/cigal/manual/chapter3/assign.txt · Last modified: 2014/08/04 16:03 (external edit)