From WikiChip
Difference between revisions of "mirc/commands/hadd"
m (Bot: Adding a template) |
m (bot: sort-key added to category) |
||
Line 55: | Line 55: | ||
{{mIRC command list}} | {{mIRC command list}} | ||
− | [[Category: | + | [[Category:mIRC commands|hadd command - mIRC]] |
Revision as of 19:11, 29 July 2014
Template:mIRC menu 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
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