- Operator

Purpose

Used to subtract numeric expressions or to indicate the negative value of a numeric expression.

Syntax 1

r = xy

Syntax 2

- y

Description

The - operator is the arithmetic subtraction operator used to find the difference between two numbers. In Syntax 2, the - operator is used as the unary negation operator (or sign) to indicate the negative value of an expression.

Example

Dim a% = 1, b! = 1

OpenW 1

Debug.Show : Debug.OnTop

Debug.Print a - b

Debug.Print a + -b

Do : Sleep : Until Win_1 Is Nothing

Debug.Hide

CloseW 1

Remarks

See Also

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

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