| CoreClasses REALbasic Plugin |
|
IVariantComparer Interface
Use this Interface to define how a container of variant can be sorted. Containers like VariantArray and VariantCollection can be sorted when they get a reference to a class that implements IVariantComparer.
Note:Interfaces don't actually do anything. A Interface is just a promise of what methods a implementor of a interface will have.
interface IVariantComparer
Methods
Compare | Implement this method to have a valid class that implements the IVariantComparer Interface.
The implemented method should return:
-1 if variant a < variant b
1 if variant a > variant b
0 if variant a = variant b
So what needs to be done is
if(variant a < variant b) then
return -1
elseif(variant a > variant b) then
return 1
else
return 0
end if |
[Footnote]
Supported Platforms:
PPC - MacOS 9Carbon - MacOS 9 and MacOS X (PEF)MacOS X PPC - (Mach-O)MacOS X Universal Binary (Mach-O)Win32 - WindowsLinux x86