Operator OrRight

From Xojo Documentation


Used to overload the Or operator, providing custom functionality.


Create an Operator_OrRight function in a class to specify the functionality of the Or operator for that class. Operator_OrRight assumes that the Self instance of the class is on the right and the passed instance is on the left.

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

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

Sample Code

Suppose you define a class myResult with the property a as Boolean. Operator_OrRight is defined as:

Function Operator_OrRight(lhs As MyResult) As Boolean
Return lhs.a Or Self.a
End Function

See Also

Or operator, Operator_Or function.