# _CP_rewind

_CP_rewind is equivalent to the rewind BASIC statement.

| Type | BASIC Statement |
| --- | --- |
| _CP_REWIND_ELSE | rewind else * return -1 |
| _CP_REWIND_ONERR | rewind else * return -1 |

## Syntax

```
int _CP_rewind(int type)
```

## Description

This function returns -1 if
an error occurs. The error code is contained in _CP_errno. PE_TAPE indicates a tape error.

Note: The tape
must have already been attached.

## Example(s)

```
/* Rewinds the tape. */
_CP_rewind(_CP_REWIND_ELSE);
```

## See also

- [C functions overview](https://d3codex.com/cfunctions/c-functions-overview/)
- [_CP_weof](https://d3codex.com/cfunctions/cp-weof/)

---
Source: https://d3codex.com/cfunctions/cp-rewind/ - part of the D3Codex reference.
