Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFObject.CompareTo Method (Object)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFObject.CompareTo Method (Object)
Compares this instance with a specified Object.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public virtual int CompareTo(
	Object obj
)
Public Overridable Function CompareTo ( 
	obj As Object
) As Integer

Dim instance As AFObject
Dim obj As Object
Dim returnValue As Integer

returnValue = instance.CompareTo(obj)
public:
virtual int CompareTo(
	Object^ obj
)
abstract CompareTo : 
        obj : Object -> int 
override CompareTo : 
        obj : Object -> int 

Parameters

obj
Type: SystemObject
The object to be compared.

Return Value

Type: Int32

A 32-bit signed integer that indicates the relative order of the comparands. The return value has these meanings:

ValueMeaning
Less than zero This instance is less than obj.
Zero This instance is equal to obj.
Greater than zero This instance is greater than obj.

Implements

IComparableCompareTo(Object)

Exceptions

ExceptionCondition
ArgumentException The obj parameter is not the same type as this instance.

Remarks

By definition, any object compares greater than and two null references compare equal to each other.

This method uses the names of the objects to perform the comparison operation if the object has a Name property. Otherwise, the ID property is used for the comparison.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in