# gosub statement

The gosub statement transfers control
to a local subroutine identified by a statement label within the program.
Control returns to the next statement after the gosub statement when the return statement is encountered.

## Syntax

```
gosub statement.label{:}
```

## Parameter(s)

| statement.label | Identifies the local subroutine to which control is transferred. |
| --- | --- |

## See also

- [return statement](https://d3codex.com/pickbasic-flashbasic/return-statement/)
- [statement labels](https://d3codex.com/pickbasic-flashbasic/statement-labels/)
- [subroutine statement](https://d3codex.com/pickbasic-flashbasic/subroutine-statement/)

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