-= Operator

Subtracts the value of an expression from the value of a variable, then assigns the result to the variable.

Syntax

variable -= expression

Parts

variable
Required numeric variable
expression
Required numeric expression

Remarks

The following two statements are functionally equivalent.

variable -= expression
variable = variable - expression

Examples

Variable

x = 50
x -= 8
After execution
variablevalue
x42

Property

' Initialize property
#person.weight = 80kg
' Change weight property
#person.weight -= 10kg

See also