Invert selection for line(s)

Command group Flag affected Reversible Execute on client Platform(s)
List lines YES NO NO All

Syntax

Invert selection for line(s) ([All lines]) {line-number (calculation)}

Options

All lines If specified, the command affects all the lines in the list

Deprecated Command

This command has been deprecated and is no longer visible in the Code Assistant in the Code Editor (it will not appear when you type the first few characters), although it is still present in Omnis Studio and will continue to function if used in legacy code. You can show this command by disabling the appropriate Command Filter in the Modify menu in the Code Editor.

Description

This command inverts the selection state of a line, that is, from selected to deselected or vice-versa. You can specify a particular line in the list by entering either a number or a calculation. You can show the selection state on the window by invoking the Redraw lists (Selection only) command.

The All lines option inverts the selection states of all lines of the current list. If no line number is given, the current line selection is inverted. When a list is saved in the data file, the selection state of each line is stored. The following example selects all but the middle line of the list:

Example

# Select list lines 2 and 4 and then invert the selection
# so list lines 1,3 and 5 are selected
Set current list lMyList
Define list {lName,lAge}
Add line to list {('Fred',10)}
Add line to list {('George',20)}
Add line to list {('Harry',22)}
Add line to list {('William',31)}
Add line to list {('David',62)}
Select list line(s) {2}
Select list line(s) {4}
Invert selection for line(s) (All lines)