---
name: "breakWith"
type: command
status: ok
groups: ["Program Flow"]
arma3_since: "2.02"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/breakWith
revid: 349341
updated: 2023-11-08T14:53:30Z
---

# breakWith

*Command · Program Flow · Arma 3 v2.02*

## Description

Skips all loop iterations and immediately returns the given value.

## Syntax

```sqf
breakWith return
```

**Parameters:**

- `return`: [Anything](../topics/Anything.md) - value to be returned when iterations are skipped

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

## Examples

### Example 1

```sqf
// stops once _i reaches 5 and outputs 0, 1, 2, 3, 4, END
systemChat call {
    for "_i" from 0 to 10 do {
        if (_i == 5) then { breakWith "END"; };
        systemChat str _i;
    };
};
```

## See also

[continueWith](../commands/continueWith.md) · [break](../commands/break.md) · [continue](../commands/continue.md) · [breakOut](../commands/breakOut.md)

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