Operator_IntegerDivide
From Xojo Documentation
Supported for all project types and targets.
Used to overload the Integer Division operator, providing custom functionality.
Used to overload the Integer Division operator, providing custom functionality.
Notes
Create an Operator_IntegerDivide function in a class to specify the functionality of the Integer_Division operator for that class.
In the function, the Self instance is the left operand and the other operand is passed as a parameter. Whenever you use the Integer_Division operator in your code to operate on two instances of the class and the Self instance is on the left, your Operator_IntegerDivide function will be called.
Sample Code
Using the Vector class (see Operator_Add) with two Integer elements, x and y, we define an Operator_IntegerDivide function that divides the sum of the Self instance with the passed instance.
Var a, b As Integer
a = Self.x + Self.y
b = rhs.x + rhs.y
Return a \ b
End Function
See Also
Operator_IntegerDivideRight, Integer Division functions.