NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

- Operator

Used to find the difference between two numbers or to indicate the negative value of a numeric expression.

Syntax 1

result = number1–number2

Syntax 2

number

The operator syntax has these parts:

Arguments

Part
Description
result
Required; any numeric variable.
number
Required; any numeric expression.
number1
Required; any numeric expression.
number2
Required; any numeric expression.

Remarks

In Syntax 1, 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 to indicate the negative value of an expression.

The data type of result is usually the same as that of the most precise expression. The order of precision, from least to most precise, is Byte, Short Integer, Long, Single, Double, and Decimal. The following are exceptions to this order: If Then result is
Subtraction involves a Single and a Long, converted to a Double.
The data type of result is a Long, or Single, that overflows its legal range, A Run-time error will occur.
The data type of result is a Byte object that overflows its legal range, A Run-time error will occur.
The data type of result is an Integer object that overflows its legal range, A Run-time error will occur.

One or both expressions arestated as Nothing, a Variable Not Set error occurs. If an expression is Empty, it is treated as 0.

Note   The order of precision used by addition and subtraction is not the same as the order of precision used by multiplication.

See Also

Example

-= Operator | Arithmetic Operators | Operator Precedence in Visual Basic | Operator Summary