Subtraction Operator (-)
Finds the difference between two numbers or indicates the negative value of a numeric expression.
Syntax
-
result = number1-number2
-
-Number
Arguments:
-
Result: Any numeric variable.
-
Number: Any numeric expression.
-
number1: Any numeric expression.
-
number2: 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.
If both expressions are Null expressions, result is zero (0). If an expression is Empty or Null, it is treated as Zero (0).
The following examples illustrates the use of subtraction operator.
Example 1:
Dim num1, num2, result
num1 = 20
num2 = 5
result = num1 - num2
'Output -> 15