Operator
Less than
Description
Used to determine whether one quantitative or alphabetic expression is smaller than another. String comparisons are case-insensitive.
Usage
result = expression1 < expression2
Part |
Type |
Description |
---|---|---|
result |
Returns True if expression1 is less than expression2. |
|
expression1 |
Any alphabetic or quantitative expression. |
|
expression2 |
Any alphabetic or quantitative expression. |
Notes
A string is "Less than" another string if it is first when the two strings are sorted alphabetically. Use String.Compare to do a case-sensitive String comparison.
You can use Operator Compare to define comparisons for classes.
Sample code
This example uses the < operator to evaluate a and b.
Var a,b As Integer
If Not TextField1.Text.IsEmpty And Not TextField2.Text.IsEmpty Then
a = TextField1.Text.ToInteger
b = TextField2.Text.ToInteger
If a < b Then
MessageBox("A is Less Than B!")
Else
System.Beep
End If
Else
MessageBox("Please enter values into both boxes!")
End If
Compatibility
All project types on all supported operating systems.
See also
>, >=, Less than, <= =, <> operators; Operator Compare, String.Compare functions; Operator precedence.