Hdel » History » Revision 4
Revision 3 (Per Amundsen, 05/24/2018 10:16 AM) → Revision 4/5 (Per Amundsen, 01/04/2019 09:20 PM)
_Added in 1.9.0_
*/hdel [-sw] <name> <item>*
Deletes an item from a hash table.
_See also [[/hsave]], [[/hload]], [[/hmake]], [[/hfree]], [[$hget]], [[$hfind]]._
*Switches*
-s - Displays the result.
-w - Indicates item is a [[Scripting_Wildcards|wildcard]].
*Parameters*
<name> - The hashtable to delete from.
<item> - The hashtable item to delete.
*Example*
<pre>
alias example {
; Create a hash table
/hadd -m example academic a
; Add some items to the hash table..
/hadd example academy a
/hadd example accelerate a
/hadd example accelerator a
/hadd example accept a
/hadd example access a
/hadd example accident a
/hadd example because b
; Print number of items.
//echo -a $hget(example, 0).item
; Remove everything matching wildcard 'a*'.
/hdel -w example a*
; Print number of items.
//echo -a $hget(example, 0).item
; Free table.
/hfree example
}
</pre>