Operator_Or

From Xojo Documentation

Revision as of 07:04, 18 August 2021 by RobinLM (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Global Method

Operator_Or(rightHandSide As Type) As Type

Supported for all project types and targets.

Used to overload the Or operator, providing custom functionality.


Global Method

Operator_Or() As Type

Supported for all project types and targets.

Used to overload the Or operator, providing custom functionality.

Notes

Create an Operator_Or function in a class to specify the functionality of the Or operator for that class. Whenever you use the Or operator in your code to operate on two instances of the class, your Operator_Or function will be called.

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

Sample Code

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

Function Operator_Or(rhs As MyResult) As Boolean
Return Self.a Or rhs.a
End Function

See Also

Or operator, Operator_OrRight function.