Test if list line selected

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

Syntax

Test if list line selected {line-number (calculation)}

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 tests the specified line of the current list and sets the flag if it is selected. You can specify a particular line in the list by entering either a number or a calculation. If the number is not specified, the test is performed on the current line of the list, that is, the line number held in LIST.$line.

Example

# If line 2 is selected show a message dialog
Set current list lMyList
Define list {lName,lBalance}
Add line to list {('Fred',100)}
Add line to list {('George',0)}
Add line to list {('Harry',50)}
Select list line(s) {2}
Test if list line selected {2}
If flag true
  OK message {List line 2 is selected}
End If
# Alternatively, you can check the $selected property
If lMyList.2.$selected
 OK message {List line 2 is selected}
End If