compareGtr

compareGtr(rhs:         String;
           bIgnoreCase: Boolean;
           bUseLocale:  Boolean;
           locale:      Locale): Boolean;

The compareGtr method of the String primitive type returns true if the receiver is greater than the value of the rhs parameter; otherwise, it returns false.

Parameters enable you to make the comparison case-sensitive or case-insensitive, and to use the sort order associated with a locale or the strict binary sort order. (These are the same comparison options that you can specify on dictionary keys.)

The relational binary comparison operator (>), documented in Chapter 1 of the JADE Developer’s Reference, uses a strict binary value comparison.

If the value of the bIgnoreCase parameter is false:

If the value of the bIgnoreCase parameter is true:

The code fragment in the following example shows the use of the compareGtr method.

vars
    locale : Locale;
begin
    write "alice".compareGtr("carol", false, false, null);  // Outputs false
    write "bob".compareGtr("bob", false, false, null);      // Outputs false
    write "carol".compareGtr("alice", false, false, null);  // Outputs true
// Comparisons with accented characters using binary and locale sort orders
    locale := currentSchema.getLocale("5129");
    write "àcute".compareGtr("zebra", false, false, null);  // Outputs true
    write "àcute".compareGtr("zebra", false, true, locale); // Outputs false