From WikiChip
Difference between revisions of "mirc/commands/hadd"
m (Bot: Fixing links) |
m (Bot: Automated text replacement (-<small>Note: Individual switches were not taken into consideration.</small> +)) |
||
Line 42: | Line 42: | ||
Added On: 05/09/2000 | Added On: 05/09/2000 | ||
− | + | ||
== See also == | == See also == |
Revision as of 21:15, 5 July 2014
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/09/2000
See also
mIRC commands list