Assignment OperatorsAssignment operators set a variable to a given value. In the following examples, "variable" denotes an operand which must be a variable, while "number" may be a variable or constant of numeric type, or an operator that returns a numeric value. Where "operand" is used, you may substitute a variable or operand of any data type, or another operator.
Elzed supports the following assignment operators:
addition assignment
variable += number
Sets numeric variable to the value of variable + number. Returns the new value of the variable.
assignment
variable = operand
Sets variable to the value of operand. Operand may be numeric, string, or boolean. Returns the new value of the variable.
division assignment
variable /= number
Sets numeric variable to the value of variable / number. Returns the new value of the variable.
exchange assignment
variable1 <=> variable2
Sets variable one to the value of variable two, and vice versa. Returns the new value of variable one.
modulo assignment
variable %= number
Sets numeric variable to the value of variable % number. Returns the new value of the variable.
multiplication assignment
variable *= number
Sets numeric variable to the value of variable * number. Returns the new value of the variable.
subtraction assignment
variable -= number
Sets numeric variable to the value of variable - number. Returns the new value of the variable.
|