++ Command

Purpose

Increments a numeric variable.

Syntax

x++

x:numeric variable

Description

x ++ increments the value of x by 1.

Example

OpenW # 1

Dim x# = 2.7

x ++

Print x      // Prints 3.7

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++ the following can be used instead:

x = x + 1

x := x + 1

x += 1

Inc x

Sub x, -1

Add x, 1

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}