+= Assignment

Purpose

Adds a numeric expression to a numeric variable.

Syntax

x += y

x:variable
y:aexp

Description

x += y adds the expression y to the value in variable x.

Example

OpenW # 1

Dim x# = 17

x += 5 * 5

Print x     // Prints 42

Remarks

Although += can be used with any numeric variable, the usage of integer variables is recommended in order to achieve the maximum optimization for speed.

Instead of x += y the following can be used instead:

x = x + y

x := x + y

Add x, y

When integer variables are used += doesn't test for overflow!

See Also

+, -, ^, *, /, \, %, Dec, (dec,popfont,9,9,-1,-1)">Dec, Inc, Add, Sub, Mul, Div, ++, --, +=, -=, /= , *=, Operator Hierarchy

{Created by Sjouke Hamstra; Last updated: 24/06/2017 by James Gaite}