# rewind statement

The rewind statement rewinds the currently
attached magnetic tape unit to the beginning of the tape.

## Syntax

```
rewind [then|else|onerr statement.block]
```

## Description

If the tape is not attached
or not online, the else or onerr clause, if present, is executed. Otherwise the then clause is executed. In addition, the onerr clause
can be used to check for a tape unit not ready error.

Either else or onerr can be specified, but
not both.

## Example(s)

```
execute ’t-att’
rewind else
crt ’cannot rewind the tape’
stop
end
```

## See also

- [if statement](https://d3codex.com/pickbasic-flashbasic/if-statement/)
- [ifr statement](https://d3codex.com/pickbasic-flashbasic/ifr-statement/)
- [onerr clause](https://d3codex.com/pickbasic-flashbasic/onerr-clause/)
- [readt statement](https://d3codex.com/pickbasic-flashbasic/readt-statement/)
- [readtx statement](https://d3codex.com/pickbasic-flashbasic/readtx-statement/)
- [statement blocks](https://d3codex.com/pickbasic-flashbasic/statement-blocks/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [system() function](https://d3codex.com/pickbasic-flashbasic/system-function/)
- [t-att command](https://d3codex.com/tcl/t-att-command/)
- [t-rew command](https://d3codex.com/tcl/t-rew-command/)
- [then/else statement blocks](https://d3codex.com/pickbasic-flashbasic/then-else-statement-blocks/)
- [weof statement](https://d3codex.com/pickbasic-flashbasic/weof-statement/)

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