$hfind » History » Version 12
Per Amundsen, 11/05/2019 03:14 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$hfind(name|N,text,[N],[M],[@window|command])* |
||
4 | |||
5 | Searches table for the Nth item name which matches text and returns the item name. |
||
6 | |||
7 | 10 | Per Amundsen | _See also [[/hsave]], [[/hload]], [[/hmake]], [[/hfree]], [[/hdel]], [[$hget]]._ |
8 | |||
9 | 11 | Per Amundsen | _See also [[$hmatch]], [[$hregex]]._ |
10 | 7 | Per Amundsen | |
11 | 1 | Per Amundsen | *Parameters* |
12 | |||
13 | name|N - Name of the hash table or the Nth hash table. |
||
14 | text - Text to search for. |
||
15 | [N] - If N = 0, number of matches, otherwise the Nth match. (optional) |
||
16 | [M] - (optional) |
||
17 | <pre> |
||
18 | n - Normal text comparison. (default if M is not specified) |
||
19 | 9 | Per Amundsen | w - Text is wildcard text. |
20 | W - Hash table item/data is wildcard text. |
||
21 | r - Text is a regular expression. |
||
22 | 6 | Per Amundsen | R - Hash table item/data is a regular expression. |
23 | 12 | Per Amundsen | N - Use case-sensitive match. (AdiIRC only) |
24 | 1 | Per Amundsen | </pre> |
25 | |||
26 | 4 | Per Amundsen | [@window|command] - if @window is defined, fills the side-listbox with the results, otherwise the command is run on each result. |
27 | 1 | Per Amundsen | |
28 | *Properties* |
||
29 | |||
30 | .data - Search for a matching data value instead of item name. |
||
31 | |||
32 | *Example* |
||
33 | |||
34 | <pre> |
||
35 | ; Searches hash table 'Example' for all items using and runs the command 'echo -ag $1-' on each result, $1- holds the item name or data. |
||
36 | //echo -ag result: $hfind(Example, *, 0, w, echo -ag $1-) |
||
37 | |||
38 | ; Searches the hash table 'Example' and prints the number of matches. |
||
39 | //echo -ag result: $hfind(Example, *, 0, w) |
||
40 | |||
41 | ; Searches the hash table 'Example' and prints the first matched item. |
||
42 | //echo -ag result: $hfind(Example, *, 1, w) |
||
43 | |||
44 | ; Searches the hash table 'Example' and prints the first matched data. |
||
45 | //echo -ag result: $hfind(Example, *, 1, w).data |
||
46 | </pre> |