NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

IComparable.CompareTo

When implemented by a class, compares the current instance with another instance of the same type.

[Visual Basic]
Function CompareTo( _
   ByVal object As Object _
) As Integer
[C#]
int CompareTo(
   object object
);
[C++]
int CompareTo(
   Object* object
) = 0;
[JScript]
function CompareTo(
   object : Object
) : int;

Parameters

object
The Object to compare with the current instance.

Return Value

Value Condition
a value less than zero The current instance is less than object.
zero The current instance is equal to object.
a value greater than zero The current instance is greater than object.

Exceptions

Exception Type Condition
ArgumentException object is not the same type as the current instance.

Remarks

a null reference (in Visual Basic Nothing) can always be compared with any other type; therefore, comparisons with a null reference (Nothing) will not generate an exception. When sorting, a null reference (Nothing) is considered to be less than any other object.

See Also

IComparable Interface | IComparable Members | System Namespace