OnCompare  Array

The OnCompare event is called when two items must be compared.

Syntax

Integer Array.OnCompare(
     Pointer obj1,
     Pointer obj2,
     Integer mode)

Parameters

obj1Reference of the first item to compare.
obj2Reference of the second item to compare.
modeValue of the compare mode (Array.GetCompareMode).

Return value

The OnCompare event returns a negative value if the first item is smaller than the second item, 0 if both are identical or a positive value if the first item is bigger.

Example

message Integer Application.Array.OnCompare(Pointer obj1, Pointer obj2, Integer mode)
{
    // It has CMP_DESCENDING
    if FLAG(mode, Array.CMP_DESCENDING)
    end
    
    // It has CMP_SAMETYPE
    if FLAG(mode, Array.CMP_SAMETYPE)
    end
}
SECCIA Documentation - Copyright © 2001-2009 Sylvain Seccia