---
name: "else"
type: command
status: ok
groups: ["Program Flow"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/else
revid: 364827
updated: 2024-06-16T09:33:24Z
---

# else

*Command · Program Flow · Arma 3 v0.50 · introduced in Operation Flashpoint v1.85*

## Description

Executes [else](../commands/else.md) code when [if](../commands/if.md) condition returns [false](../commands/false.md).

## Syntax

```sqf
thenCode else elseCode
```

**Parameters:**

- `thenCode`: [Code](../topics/Code.md)
- `elseCode`: [Code](../topics/Code.md)

**Returns:** [Array](../topics/Array.md) with [thenCode, elseCode]
- thenCode: [Code](../topics/Code.md)
- elseCode: [Code](../topics/Code.md)

## Examples

### Example 1

```sqf
if (a > b) then { c = 0 } else { c = 1 };
```

### Example 2

```sqf
if (a < b) then {
    hint "B is greater than A";
} else {
    hint "A is greater than B";
};
```

## See also

[Control Structures](../topics/Control_Structures.md) · [if](../commands/if.md) · [then](../commands/then.md)

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