-= Assignment

Purpose

Subtracts a numeric expression from a numeric variable.

Syntax

x -= y

x:variable
y:aexp

Description

x -= y subtracts the expression y from the value in variable x.

Example

OpenW # 1

Dim x = 57

x -= 3 * 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

x = x - y

x := x - y

Sub x, y

can be used also. When integer variables are used -= doesn't test for overflow!

See Also

+, -, ^, *, /, \, %, Add, Sub, Mul, Div, ++, --, +=, -=, /= , *=, Operator Hierarchy

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