Project

General

Profile

$fline » History » Version 7

Per Amundsen, 12/23/2019 01:16 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 7 Per Amundsen
_See also [[$flinen]]._
8
9 1 Per Amundsen
*Parameters*
10
11
@name - The custom window name to search.
12 5 Per Amundsen
wildtext - [[Scripting_Wildcards|Wildcard]] text to search for.
13 1 Per Amundsen
[N] - If N = 0 returns number of matches, otherwise the Nth match. (Optional, default is 1)
14 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 
15
[[Scripting_Regex|regular expression]], and 3 for both. (Optional)
16
[S] - Start the search at the Sth line.
17 1 Per Amundsen
18
*Example*
19
20
<pre>
21
; Open a custom window.
22
/window @Example
23
24
; Add some lines
25
/aline @Example Test1
26
/aline @Example Test2
27
/aline @Example Test3
28
29
; Search the display area for the wildtext 'Text*' and print number of results.
30
//echo -ag $fline(@Example, Test*, 0)
31
32
; Search the display area for the wildtext 'Text*' and print the second result.
33
//echo -ag $fline(@Example, Test*, 2)
34
</pre>