# exchange command

The exchange BASIC program switches
item-IDs of the two specified items following the file reference.

## Syntax

```
exchange file.reference item-ID1 item-ID2
```

## Example(s)

Swaps the item-IDs for program
1 and program 2. After *exchanging* the *body* of program
2, it is associated with the item-ID program 1 and vice-versa.

```
exchange bp program1 program2
Item &#39;program1&#39; exchanged with &#39;program2&#39; in file &#39;bp&#39;
```

## See also

- [File reference (Access Query Language)](https://d3codex.com/access/file-reference-access-query-language/)
- [Item-ID](https://d3codex.com/definitions/item-id-glossary/)

---
Source: https://d3codex.com/tcl/exchange-command/ - part of the D3Codex reference.
