Compares the current object to another object. The UInt16 type is not CLS compliant. The CLS-compliant alternative is Int16.
[C#] public virtual int CompareTo( object value ); [C++] public: virtual int CompareTo( Object* value ); [JScript] public function CompareTo( value : Object ) : int;
[Visual Basic] The UInt16 type cannot be used in Visual Basic.
Value | Condition |
---|---|
Less than 0 | The current object is less than the object. |
0 | The current object is equal to the object. |
Greater than 0 | The current object is greater than the object. |
Exception Type | Condition |
---|---|
ArgumentException | If the object is not a UInt16 type and is not a null reference (in Visual Basic Nothing). |
When the value parameter is null, it is considered to be less than any instance.
UInt16 Structure | UInt16 Members | System Namespace | Int32 | Object