Hdel » History » Version 3
Per Amundsen, 05/24/2018 10:16 AM
| 1 | 1 | Per Amundsen | _Added in 1.9.0_ |
|---|---|---|---|
| 2 | |||
| 3 | */hdel [-sw] <name> <item>* |
||
| 4 | |||
| 5 | Deletes an item from a hash table. |
||
| 6 | |||
| 7 | *Switches* |
||
| 8 | |||
| 9 | -s - Displays the result. |
||
| 10 | 3 | Per Amundsen | -w - Indicates item is a [[Scripting_Wildcards|wildcard]]. |
| 11 | 1 | Per Amundsen | |
| 12 | *Parameters* |
||
| 13 | |||
| 14 | <name> - The hashtable to delete from. |
||
| 15 | <item> - The hashtable item to delete. |
||
| 16 | |||
| 17 | *Example* |
||
| 18 | |||
| 19 | <pre> |
||
| 20 | alias example { |
||
| 21 | 2 | Per Amundsen | ; Create a hash table |
| 22 | 1 | Per Amundsen | /hadd -m example academic a |
| 23 | 2 | Per Amundsen | |
| 24 | ; Add some items to the hash table.. |
||
| 25 | 1 | Per Amundsen | /hadd example academy a |
| 26 | /hadd example accelerate a |
||
| 27 | /hadd example accelerator a |
||
| 28 | /hadd example accept a |
||
| 29 | /hadd example access a |
||
| 30 | /hadd example accident a |
||
| 31 | /hadd example because b |
||
| 32 | |||
| 33 | 2 | Per Amundsen | ; Print number of items. |
| 34 | //echo -a $hget(example, 0).item |
||
| 35 | 1 | Per Amundsen | |
| 36 | 2 | Per Amundsen | ; Remove everything matching wildcard 'a*'. |
| 37 | 1 | Per Amundsen | /hdel -w example a* |
| 38 | |||
| 39 | 2 | Per Amundsen | ; Print number of items. |
| 40 | //echo -a $hget(example, 0).item |
||
| 41 | 1 | Per Amundsen | |
| 42 | 2 | Per Amundsen | ; Free table. |
| 43 | 1 | Per Amundsen | /hfree example |
| 44 | } |
||
| 45 | </pre> |