Hmake » History » Version 4
Per Amundsen, 01/04/2019 09:18 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | */hmake [-s] <name> <N>* |
||
4 | |||
5 | Creates a new hash table with N slots. |
||
6 | |||
7 | 4 | Per Amundsen | _See also [[/hsave]], [[/hload]], [[/hfree]], [[/hadd]], [[/hdel]], [[$hget]], [[$hfind]]._ |
8 | |||
9 | 1 | Per Amundsen | *Switches* |
10 | |||
11 | 2 | Per Amundsen | -s - Displays a creation result. |
12 | 1 | Per Amundsen | |
13 | *Parameters* |
||
14 | |||
15 | <name> - The hashtable name to create. |
||
16 | <N> - The initial number of hashtable items. |
||
17 | |||
18 | *Example* |
||
19 | |||
20 | 3 | Per Amundsen | <pre> |
21 | 1 | Per Amundsen | ; call the setup once |
22 | ; /example |
||
23 | ; |
||
24 | ; //echo -a $abbr(lol) |
||
25 | ; |
||
26 | alias example { |
||
27 | ;Create the table. |
||
28 | /hmake abbr 1000 |
||
29 | |||
30 | ;Populate the table. |
||
31 | /hadd abbr lol laughing out load |
||
32 | /hadd abbr omg oh my gosh |
||
33 | /hadd abbr lmao laughing my a?? off |
||
34 | /hadd abbr brb be right back |
||
35 | } |
||
36 | ; get the abbreviation |
||
37 | alias abbr return $hget(abbr, $1) |
||
38 | 3 | Per Amundsen | </pre> |