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!

Int64.CompareTo

Compares this instance to the specified Object.

[Visual Basic]
Overridable Public Function CompareTo( _
   ByVal value As Object _
) As Integer
[C#]
public virtual int CompareTo(
   object value
);
[C++]
public: virtual int CompareTo(
   Object* value
);
[JScript]
public function CompareTo(
   value : Object
) : int;

Parameters

value
An object to compare with this instance.

Return Value

Value Type Condition
A negative integer If this instance is less than the object.
Zero If this instance and the object have the same value.
A positive integer If this instance is greater than the object.
A positive integer If the object is a null reference (in Visual Basic Nothing). This is a special case

Exceptions

Exception Type Condition
ArgumentException If the object is not a null reference and is not a type Int64.

Remarks

When comparing two Int64 values, canonical ordering is used. As a special case, an instance, regardless of its value, is considered to be greater than a null reference.

You should use the CompareTo method instead of subtraction because very large negative numbers will wrap to positive.

The object parameter must be a Int64 type and a null reference.

See Also

Int64 Structure | Int64 Members | System Namespace | Object