Assignment statement

An assignment statement copies data from one memory area to another.



Syntax diagram for the assignment statement

target
A variable.
source
Another variable, or a literal.

Complex assignment operators

The equal sign (=) is a simple assignment operator. Complex assignment operators in EGL perform one operation, then assign the result of that operation to the target operand. For example, the expression "a += b" is equivalent to the following expression:
a = a + b

The following table shows the complex assignment operators available in EGL.

Table 1.
Operator Meaning
a += b a = a + b
a –= b a = a – b
a *= b a = a * b
a /= b a = a / b
a **= b a = a ** b
a %= b a = a % b
a |= b a = a | b
a &= b a = a & b
a xor= b a = a xor b
a <<= n a = a << n
a >>= n a = a >> n
a>>>=n a = a >>> n
a ::= b a = a :: b
a?:= b a = a ?: b