Project

General

Profile

Added in 1.9.0

$sline(@name,N)

Returns the Nth selected line in a listbox.

Parameters

@name - The window name.
N - If N = 0, returns the total number of selected lines in the window, otherwise the Nth line.

Properties

.ln - Returns the line number of Nth selected line.

Example

; Create a custom window with a listbox.
/window -l @example

; Add some items to the listbox.
/aline @example Test1
/aline @example Test2
/aline @example Test2

; Select the second line in the listbox.
/sline @example 2

; Print the number og selected lines in the listbox.
//echo -ag $sline(@example, 0)

; Print the value of the first selected line in the listbox.
//echo -ag $sline(@example, 1)

; Print the line number of the first selected line in the listbox.
//echo -ag $sline(@example, 1).ln

Also available in: PDF HTML TXT