Project

General

Profile

$sline » History » Revision 2

Revision 1 (Per Amundsen, 08/10/2015 08:13 AM) → Revision 2/3 (Per Amundsen, 08/10/2015 08:13 AM)

_Added in 1.9.0_ 

 *$sline(@name,N)* $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* 

 <pre> 
 ; 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 
 </pre>