# Secondary list

Secondary lists are created using the s option with the
 select, sselect or get-list commands.
 Its is only used when running compare and copy
 commands.

An example use of a secondary list is as follows:

- Create the primary list.

- Create the secondary list (using the s option).

- Invoke the copy or compare command.

- Enter the file name, preceded by a ( (left parenthesis), when the system prompts to:.

 The secondary list takes over and is used for output and comparison IDs. When used with the
 copy command, the secondary list is used to supply the item-ids for the file
 that you are copying to. When used with the compare command, the secondary
 list is used to provide the item-ids to compare to.

 The end command can be used to deactivate an active or secondary
 list.

 Warning:
 Once a list is *active*, the next command issued at TCL must be a valid list-processing
 command, otherwise the list vanishes. For example:

```
sselect entity by name
[404] 2718281 items selected out of 2718281 items.
time
06:44:22 19 Jan 2002 Sunday
```

 The list generated by the sselect command is no longer active.

## Example(s)

The following commands compare two files containing FlashBASIC program source with the ids for
 the BP file coming from the primary list and the ids used for the second file from the secondary
 list.

```
sselect bp by mod.date
[404] 75 items selected out of 75 items.
sselect old.bp with mod.date (s
[404] 75 items selected out of 75 items.
compare bp
with: (oldbp
```

 This program copies items in the entity file to a work file using the item-IDs kept in the
 list, targets.

```
sselect entity by zip
[404] 1600 items selected out of 1600 items.
gl targets (s
[404] 1600 items selected.
copy entity
to: (work
```

## See also

- [Active list](https://d3codex.com/definitions/active-list/)
- [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/)
- [end command (TCL commands)](https://d3codex.com/tcl/end-command-tcl-commands/)
- [fl command](https://d3codex.com/tcl/fl-command/)
- [get-list command](https://d3codex.com/tcl/get-list-command/)
- [nselect command](https://d3codex.com/access/nselect-command/)
- [Primary list](https://d3codex.com/definitions/primary-list/)
- [readnext statement](https://d3codex.com/pickbasic-flashbasic/readnext-statement/)
- [save-list command](https://d3codex.com/tcl/save-list-command/)
- [nselect command](https://d3codex.com/access/nselect-command/)
- [clearselect statement](https://d3codex.com/pickbasic-flashbasic/clearselect-statement/)
- [sselect command](https://d3codex.com/access/sselect-command/)

---
Source: https://d3codex.com/definitions/secondary-list/ - part of the D3Codex reference.
