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!

Comparison Operators

Used to compare expressions.

Arguments

Part
Description
result
Required; any numeric variable.
expression
Required; any expression.
comparisonoperator
Required; any comparison operator.
object
Required; any object name.
string
Required; any string expression.
pattern
Required; any string expression or range of characters.

Remarks

The following table contains a list of the comparison operators and the conditions that determine whether result is True or False.

Operator True if False if
< (Less than) expression1 < expression2 expression1 >= expression2
<= (Less than or equal to) expression1 <= expression2 expression1 > expression2
> (Greater than) expression1 > expression2 expression1 <= expression2
>= (Greater than or equal to) expression1 >= expression2 expression1 < expression2
= (Equal to) expression1 = expression2 expression1 <> expression2
<> (Not equal to) expression1 <> expression2 expression1 = expression2

Note   The Is and Like operators have specific comparison functionality that differs from the operators in the table.

If expression1 and expression2 are both Object expressions, their underlying type determines how they are compared. The following table shows how the expressions are compared or the result from the comparison, depending on the underlying type of the Object:

Question: Will we need a table of some kind?

When a Single is compared to a Double, the Single is converted to a Double.

Similarly, when a Decimal is compared with a Single or Double, the Decimal will be converted to a Single or Double. For Decimal, any fractional value less than 1E-28 may be lost, or an overflow error can occur. Such fractional value loss may cause two values to compare as equal when they are not.

See Also

Example

= Operator | Is Operator | Like Operator | Operator Precedence in Visual Basic | Operator Summary | Option Compare Statement