Method

# Operator_XOrRight

<div class="rst-class">

forsearch

</div>

Operator

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

## Description

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

## Notes

Create an <span class="title-ref">Operator_XOrRight</span> function in a class to specify the functionality of the `XOr</api/language/operators/bitwise_logical/xor>` operator for that class. <span class="title-ref">Operator_XOrRight</span> assumes that the `Self</api/language/self_keyword>` instance of the class is on the right and the passed instance is on the left.

In the function, the `Self</api/language/self_keyword>` 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.

<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_XOrRight</span> is defined as:

``` xojo
Function Operator_XOrRight(lhs As MyResult) As Boolean
  Return lhs.a Xor Self.a
End Function
```

## Compatibility

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

<div class="seealso">

`XOr</api/language/operators/bitwise_logical/xor>` operator, `Operator XOr</api/language/operators/operator_overloads/operator_xor>` function.

</div>
