# sort-list command

The sort-list BASIC program retrieves
a previously saved list, sorts it, then rewrites it to the file from
which it was retrieved.

If the file reference is omitted, the process defaults
to the pointer-file file. If the list name is
omitted, the default list name, `%user-ID`, is used.

## Syntax

```
sort-list {dict|data} {file.reference} {list.name}
```

## Example(s)

Sorts the list, backorders, found
in the pointer-file file.

```
get-list backorders
sort-list backorders
```

## See also

- [compare-list command](https://d3codex.com/tcl/compare-list-command/)
- [copy-list command](https://d3codex.com/tcl/copy-list-command/)
- [delete-list command](https://d3codex.com/tcl/delete-list-command/)
- [edit-list command](https://d3codex.com/tcl/edit-list-command/)
- [fl command](https://d3codex.com/tcl/fl-command/)
- [get-list command](https://d3codex.com/tcl/get-list-command/)
- [save-list command](https://d3codex.com/tcl/save-list-command/)
- [nselect command](https://d3codex.com/access/nselect-command/)
- [sselect command](https://d3codex.com/access/sselect-command/)

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