$fline » History » Version 8
Per Amundsen, 10/09/2020 10:46 PM
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 | 8 | Per Amundsen | *Properties* |
19 | |||
20 | .text - Returns the matched text. |
||
21 | |||
22 | 1 | Per Amundsen | *Example* |
23 | |||
24 | <pre> |
||
25 | ; Open a custom window. |
||
26 | /window @Example |
||
27 | |||
28 | ; Add some lines |
||
29 | /aline @Example Test1 |
||
30 | /aline @Example Test2 |
||
31 | /aline @Example Test3 |
||
32 | |||
33 | ; Search the display area for the wildtext 'Text*' and print number of results. |
||
34 | //echo -ag $fline(@Example, Test*, 0) |
||
35 | |||
36 | ; Search the display area for the wildtext 'Text*' and print the second result. |
||
37 | //echo -ag $fline(@Example, Test*, 2) |
||
38 | </pre> |