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)}

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