# or logical operator

The or logical operator indicates that
only one of the components of a logical expression need be true for
the expression to evaluate as true.

**Synonyms:** !

## Syntax

```
exp or exp
```

## Example(s)

The expression `tax = 0 or value > 0` is true when either `tax` equals `0` and/or `value` is greater than `0`.

```
if tax = 0 or value > 0 then...
```
The expression `counter > max or value > 10 or y You can use the single attribute specification form of
the or logical operator to optimize your queries.
For example, when a numeric index on `date` is present,
the expression:

```
select invoice with date = "jan 01 2013" or = "jan 02 2013"
[4041] 16461 items selected.
```
should run significantly faster than the multiple attribute
specification form of the expression:

```
select invoice with date = "jan 01 2013" or with date = "jan 02 2013"
[404] 16461 items selected out of 2206402 items.
```
Note that in the above two examples, the message [4041] indicates that the search used an index and the message [404] indicates that no index was used.

## See also

- [! logical operator](https://d3codex.com/pickbasic-flashbasic/exclamation-logical-operator/)

---
Source: https://d3codex.com/pickbasic-flashbasic/or-logical-operator/ - part of the D3Codex reference.
