operating_assignments.htm
Navigation: Language Reference > 11 - Assignments > Assignment Statements >====== Operating Assignments ====== | |
destination | += | source | ||
destination | -= | source | ||
destination | *= | source | ||
destination | /= | source | ||
destination | = | source | ||
---|---|---|---|---|
destination | %= | source |
destination | Must be the label of a variable. This may not be a runtime property. |
source | A constant, variable, procedure, or expression. |
Operating assignment statements perform their operation on the destination and source, then assign the result to the destination. Operating assignment statements are more efficient than their functionally equivalent operations.
Example:
Operating Assignment Functional Equivalent
A += 1 A = A + 1
A -= B A = A - B
A *= -5 A = A * -5
A /= 100 A = A / 100
A ^= I + 1 A = A ^ (I + 1)
A %= 7 A = A % 7
See Also:
operating_assignments.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1