Subtracts the value of an expression from the value of a variable, then changes the variable to the result.
variable -= expression
- A numeric variable or property.
- A numeric expression
The two statements that follow operate the same.
variable -= expression variable = variable - expression
The element on the left side of
-= can be a scalar variable, a property, or an element of an array.
If it is a property, it cannot have the modifier
-= subtracts the value on its right side from the variable or property on its left side.
Then it changes the variable or property on its left side to the result of that operation.
x = 50 x -= 8