From WikiChip
Difference between revisions of "mirc/commands/hadd"
Yawhatnever (talk | contribs) (Added -k switch) |
m (Bot: de-linking old mIRC menu) |
||
Line 1: | Line 1: | ||
− | {{mirc title|/hadd Command | + | {{mirc title|/hadd Command}} |
The '''/hadd command''' inserts a new key/value pair to the hash table by the <nowiki><table></nowiki> name. If a value already exists for that key, the old value is replaced. If the table does not exist, the -m switch can be used to create the table however it will use the default value of 100 buckets, this may or may not be suitable depending on your table size. See {{mIRC|/hmake}} for more details. | The '''/hadd command''' inserts a new key/value pair to the hash table by the <nowiki><table></nowiki> name. If a value already exists for that key, the old value is replaced. If the table does not exist, the -m switch can be used to create the table however it will use the default value of 100 buckets, this may or may not be suitable depending on your table size. See {{mIRC|/hmake}} for more details. | ||
Revision as of 18:26, 15 June 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The /hadd command inserts a new key/value pair to the hash table by the <table> name. If a value already exists for that key, the old value is replaced. If the table does not exist, the -m switch can be used to create the table however it will use the default value of 100 buckets, this may or may not be suitable depending on your table size. See /hmake for more details.
Synopsis
/hadd [-mszu#] <table> <key> [value] /hadd -b[cmszu#] <table> <key> <&bvar>
Switches
- -m - Creates the hash table if it does not exist
- -s - Displays the assignment information
- -b - Treats the value as a binary variable
- -c - Truncates the &bvar at the first null value
- -z - Decreases the value by 1.0 every second; stops at zero
- -u# - Removes the key/value after # seconds
- -k - Keeps the remaining time left from the -u# switch (undocumented in help file)
Parameters
- <table> - The handle name of the table to operate on
- <key> - The key associated with the value
- [value] - The value associated with the key
- <&bvar> - The binary variable value associated with the key
Example
A basic usage for a hash table.
; call the setup once ; /abbr_setup ; ; //echo -a $abbr(lol) ; alias abbr_setup { ; populate the table, create it if it does not exist hadd -m abbr lol laughing out load hadd abbr omg oh my gosh hadd abbr lmao laughing my a?? off hadd abbr brb be right back } ; get the abbreviation alias abbr return $hget(abbr, $1)
Compatibility
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
mIRC commands list