Table of Contents

TPropertyList.Compare Method

Compares two properties for sorting purposes. This method is used by Sort method to sort the properties in the list. By default, the properties are compared by its name (sorted alphabetically). Override this method if you want to implement a different sort criteria.

Syntax

Unit: PropertyList

function TPropertyList.Compare(P1: TProperty; P2: TProperty): Integer; virtual;

Parameters

<-> Parameter Type Description
P1 TProperty First property to be compared.
P2 TProperty Second property to be compared.

Returns

Zero if properties are equal, negative value if P1 must be sorted before P2, positive value if P1 must be sorted after P2.

See also