From WikiChip
Difference between revisions of "mirc/identifiers/$hfind"
(→Properties) |
m |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{mirc title|$hfind identifier}}'''$hfind''' Searches an hash table for the Nth item name which matches text. Returns item name. | {{mirc title|$hfind identifier}}'''$hfind''' Searches an hash table for the Nth item name which matches text. Returns item name. | ||
+ | |||
+ | '''Note''': {{mIRC|/halt}} will stop the $hfind search if used from the command parameter (or inside the alias called, naturally) - note that versions prior to 7.59 this didn't work. | ||
== Synopsis == | == Synopsis == | ||
− | <pre>$hfind(name/N, text, N, M, @window | command)</pre> | + | <pre>$hfind(name/N, text, N, M, @window | command)[.data]</pre> |
== Parameters == | == Parameters == | ||
Line 11: | Line 13: | ||
* '''M''' - optional, a letter indicating how to match, default to value normal text comparison (n) below: | * '''M''' - optional, a letter indicating how to match, default to value normal text comparison (n) below: | ||
** n - normal text comparison | ** n - normal text comparison | ||
− | ** w - wildcard expression | + | ** w - {{mirc|wildcard}} expression |
− | ** W - hash table item/data is wildcard expression, see example below | + | ** W - hash table item/data is {{mirc|wildcard}} expression, see example below |
** r - regular expression | ** r - regular expression | ||
** R - hash table item/data is regular expression, see example below | ** R - hash table item/data is regular expression, see example below | ||
Line 24: | Line 26: | ||
<pre>//hadd -m test test test | hadd -m test test test1 | echo -a $hfind(test,test*,0,w) | hfree test</pre> | <pre>//hadd -m test test test | hadd -m test test test1 | echo -a $hfind(test,test*,0,w) | hfree test</pre> | ||
+ | |||
+ | <pre>//hadd -m test t*t | echo -a $hfind(test,this is a test,0,W) | hfree test</pre> | ||
+ | |||
+ | <pre>//hadd -m test t.+t | hadd -m test t(?=his) | echo -a $hfind(test,this is a test,0,R,echo -s $1) | hfree test</pre> | ||
== Compatibility == | == Compatibility == |
Latest revision as of 10:04, 10 January 2020
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$hfind Searches an hash table for the Nth item name which matches text. Returns item name.
Note: /halt will stop the $hfind search if used from the command parameter (or inside the alias called, naturally) - note that versions prior to 7.59 this didn't work.
Synopsis[edit]
$hfind(name/N, text, N, M, @window | command)[.data]
Parameters[edit]
- name/N - the Nth hash table or the name of it
- text - the expression to use to find a match
- N - The Nth match, use 0 to get the total number of match or to trigger the @window | command parameter for all matches
- M - optional, a letter indicating how to match, default to value normal text comparison (n) below:
- command | @win -- if you pass a @win name, the item name that matched is put in the window, otherwise mirc evaluate the command for each match, $1 can be used to access the item name
Properties[edit]
- .data - instead of looking for matches against item, matches against data, but the item name is still returned.
Example[edit]
//hadd -m test test test | echo -a $hfind(test,test,1) | hfree test
//hadd -m test test test | hadd -m test test test1 | echo -a $hfind(test,test*,0,w) | hfree test
//hadd -m test t*t | echo -a $hfind(test,this is a test,0,W) | hfree test
//hadd -m test t.+t | hadd -m test t(?=his) | echo -a $hfind(test,this is a test,0,R,echo -s $1) | hfree test
Compatibility[edit]
Added: mIRC v5.81
Added on: 09 Nov 2000
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
mIRC identifier list