# exit statement

The exit statement forces an early exit
from a loop that is under for...next or loop...repeat control.

## Syntax

```
exit
```

## Description

The program continues with the
next executable statement after the next or repeat statement.

Note: If the exit is not embedded in a loop...repeat or for...next construct, it is ignored.

## Example(s)

```
loop
 input guess
 if guess=’end’ then exit
while guess > 1 and guess < 100 do repeat
```

## See also

- [for...next statement](https://d3codex.com/pickbasic-flashbasic/for-next-statement/)
- [loop statement](https://d3codex.com/pickbasic-flashbasic/loop-statement/)
- [next statement](https://d3codex.com/pickbasic-flashbasic/next-statement/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)

---
Source: https://d3codex.com/pickbasic-flashbasic/exit-statement/ - part of the D3Codex reference.
