Operator

# Greater than

<div class="rst-class">

forsearch

</div>

Operator

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to determine whether one alphabetic or quantitative expression is larger than another. `String</api/data_types/string>` comparisons are case-insensitive.

## Usage

``` xojo
result = expression1 > expression2
```

| Part        | Type                                                                              | Description                                                                       |
|-------------|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| result      | `Boolean</api/data_types/boolean>`                                                | Returns `True</api/language/true>` if *expression1* is larger than *expression2*. |
| expression1 | `String</api/data_types/string>`, Number, or `DateTime</api/data_types/datetime>` | Any alphabetic or quantitative expression.                                        |
| expression2 | `String</api/data_types/string>`, Number, or `DateTime</api/data_types/datetime>` | Any alphabetic or quantitative expression.                                        |

## Notes

The data types of *expression1* and *expression2* must match.

A string is "<span class="title-ref">Greater than</span>" another string if it is last when the two strings are sorted alphabetically. Use `String.Compare<string.compare>` to do a case-sensitive `string</api/data_types/string>` comparison.

You can use `Operator Compare</api/language/operators/operator_overloads/operator_compare>` to define comparisons for classes.

## Sample code

The following sample code compares different values:

``` xojo
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
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

Greater than, `\>=</api/language/operators/comparison/greater_than_or_equal>`, `<</api/language/operators/comparison/less_than>`, `\<=</api/language/operators/comparison/less_than_or_equal>`, `=</api/language/operators/comparison/equals_operator>`, `<></api/language/operators/comparison/not_equal>` operators; `Operator Compare</api/language/operators/operator_overloads/operator_compare>`, `String.Compare<string.compare>` functions; `Operator precedence</api/language/operators/operator_precedence>`.

</div>
