Project

General

Profile

Actions

Added in 1.9.0

$sline(@name,N)

Returns the Nth selected line in a listbox.

Parameters

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

Properties

Property Description
.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

Updated by Per Amundsen over 1 year ago · 3 revisions

Also available in: PDF HTML TXT