The OnCompare event is called when two items must be compared.
Syntax
Integer Array.OnCompare(
Pointer obj1,
Pointer obj2,
Integer mode)
Pointer obj1,
Pointer obj2,
Integer mode)
Parameters
| obj1 | Reference of the first item to compare. |
|---|---|
| obj2 | Reference of the second item to compare. |
| mode | Value 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
}
{
// It has CMP_DESCENDING
if FLAG(mode, Array.CMP_DESCENDING)
end
// It has CMP_SAMETYPE
if FLAG(mode, Array.CMP_SAMETYPE)
end
}