---
name: "breakTo"
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/breakTo
revid: 364900
updated: 2024-06-29T14:38:35Z
---

# breakTo

*Command · Program Flow · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Breaks block to scope named *name*.

Scope name can be assigned using the [scopeName](../commands/scopeName.md) command.

## Syntax

```sqf
breakTo name
```

**Parameters:**

- `name`: [String](../topics/String.md)

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

## Examples

### Example 1

```sqf
scopeName "main";
while { true } do
{
    scopeName "loop1";
    while { true } do
    {
        scopeName "loop2";
        if (condition1) then { breakTo "main" };    // breaks all scopes and return to "main"
        if (condition2) then { breakOut "loop2" };    // breaks scope named "loop2"
        sleep 1;
    };
    sleep 1;
};
```

## See also

[scopeName](../commands/scopeName.md) · [breakOut](../commands/breakOut.md) · [exitWith](../commands/exitWith.md)

## Community notes

**Nelis75733126** — 2017-05-18

I wish to clarify the behaviour of this command by saying that the `breakTo` command will literally break the scope in which it has been placed, and continue reading whatever is after and outside of that scope.

Example:

```sqf
scopeName "something";
if true then
{
    breakTo "something";
    _v = 0;    // this line will be skipped
};

_a = 0;        // this is where script execution will jump to.
```

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