Click or drag to resize

Pair Class (Typed)

X#
Provide the base class from which all X# objects containing ordered pairs of values are subclassed.
Inheritance Hierarchy
Object
  VObject
    Pair
      Dimension
      Point
      Range
      Selection

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.21
Syntax
 CLASS Pair INHERIT VObject
Request Example View Source

The Pair type exposes the following members.

Constructors
  NameDescription
Public methodPair
Initializes a new instance of the Pair class
Public methodPair(Long, Long)
Construct a pair.
Top
Properties
  NameDescription
Public propertyEmpty
Is the pair empty ?(both values equal to 0)
Top
Functions
  NameDescription
Public methodDestroy
Free memory resources allocated for a VObject object and its derived objects.
(Inherited from VObject.)
Public methodGetHashCode (Overrides GetHashCode.)
Top
Globals and Defines
  NameDescription
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks

Important! Pair is an abstract class and should not be used directly—instead, use one of its subclasses, which include Dimension, Point, Range, and Selection.
Examples
In this example, fractions are represented as ordered pairs of integers:
X#
 1CLASS Fraction INHERIT Pair
 2HIDDEN Num
 3HIDDEN Denom
 4METHOD Init(nVal1,nVal2) CLASS Fraction
 5SUPER:Init(nVal1,nVal2)
 6Num := nVal1
 7Denom := nVal2
 8METHOD Numerator() CLASS Fraction
 9RETURN SELF:Num
10METHOD Denominator() CLASS Fraction
11RETURN SELF:Denom
See Also