Used to overload the / operator, providing custom functionality.


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

In the function, the Self instance is the left operand and the other operand is passed as a parameter.

Sample code

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

Function Operator_Divide(rhs As Vector) As Double
  Var a, b As Integer
  a = Self.x + Self.y
  b = rhs.x + rhs.y
  Return a / b
End Function


All project types on all supported operating systems.

See also

/ operator; Operator DivideRight function.