RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBaseArray.CompareProc Property

Implements a sort order for the elements of the array.

Pascal
property CompareProc: TCompareProc;
C++
__property TCompareProc CompareProc;

Set CompareProc to change the function that is used to sort the items of the array. If the SortOrder property is not TS_NONE, CompareProc is used to locate the position in which to add new items to the array and to locate items using the FindItem method. 

CompareProc should compare the two items given as parameters and return a value less than 0 if item1 comes before item2, return a value greater than 0 if item1 comes after item2, and return 0 if item1 is the same as item2. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!