Operator_Divide Method
Used to overload the / operator, providing custom functionality.
Syntax
Notes
Create an Operator_Divide function in a class to specify the functionality of the / operator for that class.
In the function, the Self instance the left operands and the other operand is passed as a parameter.
Example
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
Dim a, b as Integer
a= Self.x + Self.y
b=rhs.x + rhs.y
Return a / b
Dim a, b as Integer
a= Self.x + Self.y
b=rhs.x + rhs.y
Return a / b
See Also
/ operator; Operator_DivideRight function.