Method

# Operator_Or

<div class="rst-class">

forsearch

</div>

Operator

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to overload the `Or</api/language/operators/bitwise_logical/or>` operator, providing custom functionality.

## Notes

Create an <span class="title-ref">Operator_Or</span> function in a class to specify the functionality of the `Or</api/language/operators/bitwise_logical/or>` operator for that class. Whenever you use the `Or</api/language/operators/bitwise_logical/or>` operator in your code to operate on two instances of the class, your <span class="title-ref">Operator_Or</span> function will be called.

In the function, the `Self</api/language/self_keyword>` instance is the left operand and the other operand is passed as a parameter.

<div class="important">

<div class="title">

Important

</div>

This is not currently supported for Android.

</div>

## Sample code

Suppose you define a class myResult with the property a as `Boolean</api/data_types/boolean>`. <span class="title-ref">Operator_Or</span> is defined as:

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

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`Or</api/language/operators/bitwise_logical/or>` operator, `Operator OrRight</api/language/operators/operator_overloads/operator_orright>` function.

</div>
