+= Operator

Adds or concatenates the value of an expression to the value of a variable, then assigns the result to the variable.

Syntax

variable += expression

Parts

variable
Necessary numeric or string variable
expression
Necessary expression of a type compatible with variable

Instructions

The following two statements are functionally equivalent.

variable += expression
variable = variable + expression

Examples

Variable

Listing 1
x = 30
x += 12
After execution
variablevalue
x42

Property

Listing 2
' Change value of property
#obj.value += 1

See also