[Overview][Resource strings][Constants][Types][Procedures and functions][Index] | Reference for unit 'unicodedata' (#rtl)

# CompareSortKey

Compare two sort keys.

## Declaration

Source position: unicodedata.pas line 521

`function CompareSortKey(`
`const A: TUCASortKey;`
`const B: TUCASortKey`
`):Integer; overload; function CompareSortKey(`
`const A: TUCASortKey;`
`const B: array of Word`
`):Integer; overload;`

## Arguments

`A` |  | First key to compare
`B` |  | Second key to compare

## Function result

A signed number determining how A and B are alphabetically ordered.

## Arguments

`A` |  | First key to compare
`B` |  | Second key to compare

## Description

CompareSortKey compares 2 sort keys A and B. It returns

- a negative number if A comes alphabetically ordered before B.
- Zero if A is alphabetically identical to B.
- A positive number if A is alphabetically ordered after B.

Sort keys can be constructed from unicode strings using ComputeSortKey.

## See also

ComputeSortKey |  | Compute the sort key for a string