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!

Boolean.CompareTo

Compares this instance of the object to another specified object.

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

Parameters

obj
An object to compare with this instance.

Return Value

Value Condition
A negative integer If this instance is false and the object is true.
Zero If this instance and the object have the same value.
A positive integer If this instance is true and the object is false.
A positive integer If the object is null. This is a special case.

Exceptions

Exception Type Condition
ArgumentException If the object is not a Boolean and is not null.

Remarks

The CompareTo method compares this object to another object and returns an integer that indicates the relationship. For Booleans, false sorts before true.

When comparing two Boolean values, false is considered to be less than true. As a special case, a null reference is considered less than any instance.

The object parameter must be either a Boolean type or a null reference.

See Also

Boolean Structure | Boolean Members | System Namespace | Object