Operator DivideRight
From Xojo Documentation
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.
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.
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
Var a, b As Integer
a = Self.x + Self.y
b = lhs.x + lhs.y
Return b / a
End Function
See Also
/ operator; Operator_Divide function.