Unit 'LCLProc' Package
[Overview][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TStringsSortCompare

Specifies a comparison function type for string values in a TStrings instance.

Declaration

Source position: lclproc.pas line 80

type TStringsSortCompare = function(

  const Item1: string;

  const Item2: string

):Integer;

Arguments

Item1

  

First string value for the comparison.

Item2

  

Second string value for the comparison.

Function result

Integer with the relative sort order for the compared values.

Description

TStringsSortCompare is an Integer function type used to compare string values to determine the relative sort order. The return value indicates the relative sort order for the compared items, and normally contains a value like the one returned from CompareText. For example:

<0
Item1 has a value that comes before Item2.
0
Item1 and Item2 have the same value.
>0
Item1 has a value that comes after Item2.

The address for a TStringsSortCompare type is passed as an argument to the MergeSort routine.

See also

MergeSort

  

Implements a merge/sort for TStrings or TFPList.



CT Web help

CodeTyphon Studio