Operator_DivideRight Method

Used to overload the / operator, providing custom functionality.Operator_DivideRight is the same as Operator_Divide, except that the intrinsic Self is assumed to be the on the right in the division operation.

Syntax


Notes

Create an Operator_DivideRight function in a class to specify the functionality of the / operator for that class.

The ordinary methods are always preferred; REALbasic uses the Right versions only if there is no legal left version.


Example

Using the Vector class (see Operator_Add) with two Integer elements, x and y, we define an Operator_DivideRight function that divides the sum of the Self instance with the passed instance.

Function Operator_DivideRight(lhs as Vector) as Double
  Dim a, b as Integer
 a= Self.x + Self.y
 b=lhs.x + lhs.y

Return b / a

See Also

/ operator; Operator_Divide function.