Project

General

Profile

Hadd » History » Revision 5

Revision 4 (Per Amundsen, 11/30/2018 11:02 AM) → Revision 5/6 (Per Amundsen, 01/04/2019 09:20 PM)

_Added in 1.9.0_ 

 */hadd [-bcmsuNz] [-bBcmsuNz] <name> <item> [text | &binvar]* 

 Adds an item to an existing hash table. 

 _See also [[/hsave]], [[/hload]], [[/hmake]], [[/hfree]], [[/hdel]], [[$hget]], [[$hfind]]._ 

 *Switches* 

 -b - Indicates &binvar is set. 
 -B - TODO 
 -c - Chop the &binvar to first null byte. 
 -m - Creates the table if it does not exist. 
 -s - Displays the result. 
 -uN - Unset the item after N seconds. 
 -z - Decreases the item once per second until it reaches zero and then unsets it. 

 *Parameters* 

 <name> - The hash table to add to. 
 <item> - The hash table item to add to. 
 [text | &binvar] - The text or &binvar value to add. 

 *Example* 

 <pre> 
 ; 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) 
 </pre>