Greater than
From Xojo Documentation
Operator
Used to determine whether one alphabetic or quantitative expression is larger than another. String comparisons are case-insensitive.
Usage
result = expression1 > expression2
Part | Type | Description |
---|---|---|
result | Boolean | Returns True if expression1 is larger than expression2. |
expression1 | String, Number, or Date | Any alphabetic or quantitative expression. |
expression2 | String, Number, or Date | Any alphabetic or quantitative expression. |
Notes
The data types of expression1 and expression2 must match.
A string is "greater than" another string if it is last when the two strings are sorted alphabetically. Use StrComp to do a case-sensitive string comparison.
You can use Operator_Compare to define comparisons for classes.
Sample Code
The following sample code compares different values:
Var num1 As Integer = 100
Var num2 As Integer = 250
If num1 > num2 Then
' This block is skipped
Else
' This block is executed
End If
Var t1 As String = "Hello"
Var t2 As String = "World"
If t1 > t2 Then
// This block is skipped
Else
// This block is executed
End If
Var num2 As Integer = 250
If num1 > num2 Then
' This block is skipped
Else
' This block is executed
End If
Var t1 As String = "Hello"
Var t2 As String = "World"
If t1 > t2 Then
// This block is skipped
Else
// This block is executed
End If
See Also
>, >=, <, <=, =, <>, and StrComp operators; Operator_Compare function; Operator precedence.