$fline » History » Version 5
Per Amundsen, 05/24/2018 10:12 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | 4 | Per Amundsen | *$fline(@name,wildtext,[N],[T])* |
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 | 4 | Per Amundsen | [N] - If N = 0 returns number of matches, otherwise the Nth match. (Optional, default is 1) |
12 | [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) |
||
13 | 1 | Per Amundsen | |
14 | *Example* |
||
15 | |||
16 | <pre> |
||
17 | ; Open a custom window. |
||
18 | /window @Example |
||
19 | |||
20 | ; Add some lines |
||
21 | /aline @Example Test1 |
||
22 | /aline @Example Test2 |
||
23 | /aline @Example Test3 |
||
24 | |||
25 | ; Search the display area for the wildtext 'Text*' and print number of results. |
||
26 | //echo -ag $fline(@Example, Test*, 0) |
||
27 | |||
28 | ; Search the display area for the wildtext 'Text*' and print the second result. |
||
29 | //echo -ag $fline(@Example, Test*, 2) |
||
30 | </pre> |