Project

General

Profile

$fline » History » Revision 5

Revision 4 (Per Amundsen, 11/26/2015 06:52 PM) → Revision 5/9 (Per Amundsen, 05/24/2018 10:12 AM)

_Added in 1.9.0_ 

 *$fline(@name,wildtext,[N],[T])* 

 Returns Nth position of line which matches the specified [[Scripting_Wildcards|wildcard]] wildcard text. 

 *Parameters* 

 @name - The custom window name to search. 
 wildtext - [[Scripting_Wildcards|Wildcard]] Wildcard text to search for. 
 [N] - If N = 0 returns number of matches, otherwise the Nth match. (Optional, default is 1) 
 [T] - If T = 0 reference the display area (default), If T is 1, it references the listbox, 2 implies that wildtext is a [[Scripting_Regex|regular expression]], and 3 for both. (Optional) 

 *Example* 

 <pre> 
 ; Open a custom window. 
 /window @Example 

 ; Add some lines 
 /aline @Example Test1 
 /aline @Example Test2 
 /aline @Example Test3 

 ; Search the display area for the wildtext 'Text*' and print number of results. 
 //echo -ag $fline(@Example, Test*, 0) 

 ; Search the display area for the wildtext 'Text*' and print the second result. 
 //echo -ag $fline(@Example, Test*, 2) 
 </pre>