Method

# Operator_And

<div class="rst-class">

forsearch

</div>

Operator

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

## Description

Used to overload the `And</api/language/operators/bitwise_logical/and>` function, providing custom functionality.

## Notes

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

In the function, the `Self</api/language/self_keyword>` instance is one of the operands and the other operand is passed as a parameter. `Self</api/language/self_keyword>` is assumed to be on the left.

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

``` xojo
Function Operator_And(rhs As MyResult) As Boolean
  Return Self.a And rhs.a
End Function
```

## Compatibility

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

<div class="seealso">

`And</api/language/operators/bitwise_logical/and>` operator, `Operator AndRight</api/language/operators/operator_overloads/operator_andright>` function.

</div>
