Operators

Posted on

Numeric Operators

< Less Than

Is the value of the first expression less than the value of the second?
23 < 33 = True
23 < 23 = False
23 < 12 = False

> Greater Than

Is the value of the first expression greater than the value of the second?
23 > 33 = False
23 > 23 = False
23 > 12 = True

= Equality

Is The value of the first expression equal to the value of the second?
23 = 33 = False
23 = 23 = True

<> Inequality

Is The value of the first expression unequal to the value of the second?
23 = 33 = True
23 = 23 = False

<= Less Than or Equal To

Is the value of the first expression less than the value of the second?
23 < 33 = True
23 < 23 = True
23 < 12 = False

> Greater Than or Equal To

Is the value of the first expression greater than the value of the second?
23 > 33 = False
23 > 23 = True
23 > 12 = True

Strings

The numeric operators allow you to compare string values based on their sort order
“73” < “9” = True
The equality of strings using the equality operator
“734” = “734” = True
If one string is a prefix of another such as “aa” and “aaa”, the longer string is considered to be greater than the shorter string

Like

string is compared against the pattern, and if it matches , the result is True. Otherwise, the result is false
“aa” Like “a”

Is and IsNot

Compares two object reference variables to determine if two reference variables refere to the same object instance
x as Object
y as Object
set x = y
x Is y = True
x isNot y = False

TypeOf<objectexpression>Is<type name>

When typename is a class type, then the expression returns True if the object is an instance of the specified class or of a class that derives from the specified class.
Dim x as System.Windows.Form.Button
set x = New System.Windows.Form.Button
TypeOf(x) Is System.Windows.Forms.Control = True (type of x is Button which inherits from Control [is a control])