$fline » History » Version 9
Per Amundsen, 02/22/2023 04:47 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 | 9 | Per Amundsen | table(ktable). |
12 | |*Parameter*|*Description*| |
||
13 | | @name | The custom window name to search. | |
||
14 | | wildtext | [[Scripting_Wildcards|Wildcard]] text to search for. | |
||
15 | | [N] | If N = 0 returns number of matches, otherwise the Nth match. (Optional, default is 1) | |
||
16 | | [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) | |
||
17 | | [S] | Start the search at the Sth line. | |
||
18 | 6 | Per Amundsen | |
19 | *Properties* |
||
20 | 1 | Per Amundsen | |
21 | 9 | Per Amundsen | table(ktable). |
22 | |*Property*|*Description*| |
||
23 | | .text | Returns the matched text. | |
||
24 | 8 | Per Amundsen | |
25 | 1 | Per Amundsen | *Example* |
26 | |||
27 | <pre> |
||
28 | ; Open a custom window. |
||
29 | /window @Example |
||
30 | |||
31 | ; Add some lines |
||
32 | /aline @Example Test1 |
||
33 | /aline @Example Test2 |
||
34 | /aline @Example Test3 |
||
35 | |||
36 | ; Search the display area for the wildtext 'Text*' and print number of results. |
||
37 | //echo -ag $fline(@Example, Test*, 0) |
||
38 | |||
39 | ; Search the display area for the wildtext 'Text*' and print the second result. |
||
40 | //echo -ag $fline(@Example, Test*, 2) |
||
41 | </pre> |