CoreClasses Xojo Plugin

IComparer Interface

Use this Interface to define how a container of objects can be sorted. Containers like ObjectArray and ObjectCollection can be sorted when they get a reference to a class that implements IComparer.

Note:
Interfaces don't actually do anything. A Interface is just a promise of what methods a implementor of a interface will have.

interface IComparer

Methods

CompareImplement this method to have a valid class that implements the IComparer Interface. The implemented method should return: -1 if object a < object b 1 if object a > object b 0 if object a = object b So what needs to be done is if(object a < object b) then return -1 elseif(object a > object b) then return 1 else return 0 end if

[Footnote]

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM