---
name: "or"
type: command
status: ok
groups: ["Math", "Variables"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/or
revid: 369315
updated: 2024-09-03T18:42:56Z
---

# or

*Command · Math, Variables · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

Alias: [a or b](../commands/a_or_b.md)

## Description

Returns [true](../commands/true.md) if one or both conditions are [true](../commands/true.md). In case of the alternative syntax, [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation#Control_structures) is used. That means that if left operand is [true](../commands/true.md), evaluation of the right side is skipped completely.

## Syntax

### Syntax 1

```sqf
a or b
```

**Parameters:**

- `a`: [Boolean](../topics/Boolean.md) - test condition or variable
- `b`: [Boolean](../topics/Boolean.md) - test condition or variable

**Returns:** [Boolean](../topics/Boolean.md)

### Syntax 2

*since arma2oa 1.62*

```sqf
a or b
```

**Parameters:**

- `a`: [Boolean](../topics/Boolean.md) - test condition or variable
- `b`: [Code](../topics/Code.md) - code that returns [Boolean](../topics/Boolean.md). It is not evaluated if *a* returns [true](../commands/true.md)

**Returns:** [Boolean](../topics/Boolean.md)

## Examples

### Example 1

```sqf
if (_obj1 or (_enemycount == 0) or (not alive _enemyGeneral)) then { hint "you win !"; };
```

### Example 2

```sqf
// without lazy evaluation, select would throw an error in the event of an empty array
if ((count _array == 0) or { (_array select 0) != player }) then
{
    hint "It works!";
};
```

## See also

[a or b](../commands/a_or_b.md) · [and](../commands/and.md) · [Operators](../topics/Operators.md)

<sub>Source: [BI Community Wiki — or](https://community.bistudio.com/wiki/or) (revision 369315).</sub>
