Hfree » History » Version 4
Per Amundsen, 02/16/2023 12:45 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 | 4 | Per Amundsen | table(ktable). |
12 | |*Switch*|*Description*| |
||
13 | | -s | Displays the result. | |
||
14 | | -w | Indicates name is a [[Scripting_Wildcards<notextile>|</notextile>wildcard]]. | |
||
15 | 1 | Per Amundsen | |
16 | *Parameters* |
||
17 | |||
18 | 4 | Per Amundsen | table(ktable). |
19 | |*Parameter*|*Description*| |
||
20 | | <name> | The hashtable to delete. | |
||
21 | 1 | Per Amundsen | |
22 | *Example* |
||
23 | |||
24 | <pre> |
||
25 | alias example { |
||
26 | ;Create the hash table 'hash'. |
||
27 | /hmake hash |
||
28 | |||
29 | ;Print the hashtable size. |
||
30 | echo -a $hget(hash) : $hget(hash).size |
||
31 | |||
32 | ;Creates the hash table 'h' with 10 items. |
||
33 | /hmake h 10 |
||
34 | |||
35 | ;Creates the hash table 'has' with 20 items. |
||
36 | /hmake has 20 |
||
37 | |||
38 | ;Delete hash table 'hash'. |
||
39 | /hfree -s hash |
||
40 | |||
41 | ;Print the hashtable size. |
||
42 | /echo -a $hget(h) : $hget(h).size - $hget(has) : $hget(has).size |
||
43 | |||
44 | ;Deletes any hash tables matching h* |
||
45 | /hfree -sw h* |
||
46 | } |
||
47 | </pre> |