[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComboEx' (#lcl)

# TListItemsCompare

Specifies a function type used to compare items in TComboEx.

## Declaration

Source position: comboex.pas line 49

`type TListItemsCompare = function(`
`AList: TListControlItems;`
`AItem1: Integer;`
`AItem2: Integer`
`):Integer;`

## Arguments

`AList` |  | Collection with the items compared in the routine.
`AItem1` |  | Ordinal position for the first item in the comparison.
`AItem2` |  | Ordinal position for the second item in the comparison.

## Function result

Integer with the relative order for the compared values at the specified positions.

## Description

TListItemsCompare is an Integer function type used to implement a comparison between the items stored at the specified positions in AList. The return value contains the relative sort order for the compared values, for example:

-1
  Aitem1 occurs before AItem2
0
  AItem1 and AItem2 have the same values
1
  AItem1 occurs after AItem2

TListItemsCompare implements the sort operation performed in TListControlItems when its CustomSort method is called.

## See also

TListControlItems.CustomSort |  | Performs a custom sort using the specified routine.
TListControlItems.Sort |  | Performs the Sort routine required for the setting in SortType.
TListControlItems.SortType |  | Determines the comparison mechanism used for collection items in the Sort method.
TListControlItems.OnCompare |  | Event handler signalled to sort the collection using the data in the collection items.
TListControlItems.CompareItems |  | Implements a comparison function for items in the collection.