From WikiChip
Difference between revisions of "mirc/identifiers/$hget"
(→Properties) |
(→Example) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
== Synopsis == | == Synopsis == | ||
− | < | + | <source lang="mIRC"> |
− | $hget(name/N, item, [&binvar]) - returns the data associated with the item</ | + | $hget(name/N) - returns the name if the hash table exist or Nth name |
+ | $hget(name/N, item, [&binvar]) - returns the data associated with the item | ||
+ | </source> | ||
== Parameters == | == Parameters == | ||
Line 15: | Line 17: | ||
* '''.state''' - Return some internal informations about the table. The format returned is 3 tokens space separated, the first word is the number of items in the table, the second is in the format <nbr_used_buckets>/<totalnbr_buckets>, while the third consists of four number separated by a slash as well, but it's unknown what they really mean. | * '''.state''' - Return some internal informations about the table. The format returned is 3 tokens space separated, the first word is the number of items in the table, the second is in the format <nbr_used_buckets>/<totalnbr_buckets>, while the third consists of four number separated by a slash as well, but it's unknown what they really mean. | ||
* '''.hash''' - Return the name of the algorithm used by the hash table, which can be passed using the -h switch in {{mIRC|/hmake}} | * '''.hash''' - Return the name of the algorithm used by the hash table, which can be passed using the -h switch in {{mIRC|/hmake}} | ||
+ | * '''.data''' - returns the contents of the hash table item. | ||
== Example == | == Example == | ||
− | < | + | <source lang="mIRC">//hadd -m test test test | echo -a $hget(test,test) | hfree test</source> |
== Compatibility == | == Compatibility == |
Latest revision as of 13:04, 7 October 2023
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$hget returns informations about hash tables
Synopsis[edit]
$hget(name/N) - returns the name if the hash table exist or Nth name $hget(name/N, item, [&binvar]) - returns the data associated with the item
Parameters[edit]
- name/N - the Nth hash table or the name of it
- item - the name of the item you want the data of
- &binvar - if you provide a binvar as a third parameter, the associated data is copied at the beginning of the binvar and the binvar is chopped at length of the associated data (what was before in the binvar is 'deleted' before copying)
Properties[edit]
- .unset - When passing an item, you can use the .unset property to get the unset time of the item if any
- .state - Return some internal informations about the table. The format returned is 3 tokens space separated, the first word is the number of items in the table, the second is in the format <nbr_used_buckets>/<totalnbr_buckets>, while the third consists of four number separated by a slash as well, but it's unknown what they really mean.
- .hash - Return the name of the algorithm used by the hash table, which can be passed using the -h switch in /hmake
- .data - returns the contents of the hash table item.
Example[edit]
//hadd -m test test test | echo -a $hget(test,test) | hfree test
Compatibility[edit]
Added: mIRC v5.8
Added on: 05 Sep 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