Project

General

Profile

$fline » History » Version 6

Per Amundsen, 12/23/2019 01:14 AM

1 1 Per Amundsen
_Added in 1.9.0_
2
3 6 Per Amundsen
*$fline(@name,wildtext,[N],[T],[S])*
4 1 Per Amundsen
5 5 Per Amundsen
Returns Nth position of line which matches the specified [[Scripting_Wildcards|wildcard]] text.
6 1 Per Amundsen
7
*Parameters*
8
9
@name - The custom window name to search.
10 5 Per Amundsen
wildtext - [[Scripting_Wildcards|Wildcard]] text to search for.
11 1 Per Amundsen
[N] - If N = 0 returns number of matches, otherwise the Nth match. (Optional, default is 1)
12 6 Per Amundsen
[T] - If T = 0 reference the display area (default), If T is 1, it references the listbox, 2 implies that wildtext is a 
13
[[Scripting_Regex|regular expression]], and 3 for both. (Optional)
14
[S] - Start the search at the Sth line.
15 1 Per Amundsen
16
*Example*
17
18
<pre>
19
; Open a custom window.
20
/window @Example
21
22
; Add some lines
23
/aline @Example Test1
24
/aline @Example Test2
25
/aline @Example Test3
26
27
; Search the display area for the wildtext 'Text*' and print number of results.
28
//echo -ag $fline(@Example, Test*, 0)
29
30
; Search the display area for the wildtext 'Text*' and print the second result.
31
//echo -ag $fline(@Example, Test*, 2)
32
</pre>