Method

Operator_DivideRight


Description

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.

Notes

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

The ordinary (left) methods are always preferred; the Right version is used only if there is no legal left version.

Important

This is not currently supported for Android.

Sample code

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
  Var a, b As Integer
  a = Self.x + Self.y
  b = lhs.x + lhs.y

  Return b / a
End Function

Compatibility

All project types on all supported operating systems.

See also

/ operator; Operator Divide function.