Hfree » History » Version 3
Per Amundsen, 01/04/2019 09:19 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | */hfree [-sw] <name>* |
||
4 | |||
5 | Deletes a hash table. |
||
6 | |||
7 | 3 | Per Amundsen | _See also [[/hsave]], [[/hsave]], [[/hmake]], [[/hadd]], [[/hdel]], [[$hget]], [[$hfind]]._ |
8 | |||
9 | 1 | Per Amundsen | *Switches* |
10 | |||
11 | -s - Displays the result. |
||
12 | 2 | Per Amundsen | -w - Indicates name is a [[Scripting_Wildcards|wildcard]]. |
13 | 1 | Per Amundsen | |
14 | *Parameters* |
||
15 | |||
16 | <name> - The hashtable to delete. |
||
17 | |||
18 | *Example* |
||
19 | |||
20 | <pre> |
||
21 | alias example { |
||
22 | ;Create the hash table 'hash'. |
||
23 | /hmake hash |
||
24 | |||
25 | ;Print the hashtable size. |
||
26 | echo -a $hget(hash) : $hget(hash).size |
||
27 | |||
28 | ;Creates the hash table 'h' with 10 items. |
||
29 | /hmake h 10 |
||
30 | |||
31 | ;Creates the hash table 'has' with 20 items. |
||
32 | /hmake has 20 |
||
33 | |||
34 | ;Delete hash table 'hash'. |
||
35 | /hfree -s hash |
||
36 | |||
37 | ;Print the hashtable size. |
||
38 | /echo -a $hget(h) : $hget(h).size - $hget(has) : $hget(has).size |
||
39 | |||
40 | ;Deletes any hash tables matching h* |
||
41 | /hfree -sw h* |
||
42 | } |
||
43 | </pre> |