Project

General

Profile

Hmake » History » Version 5

Per Amundsen, 02/16/2023 12:45 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 5 Per Amundsen
table(ktable).
12
|*Switch*|*Description*|
13
| -s | Displays a creation result. |
14 1 Per Amundsen
15
*Parameters*
16
17 5 Per Amundsen
table(ktable).
18
|*Parameter*|*Description*|
19
| <name> | The hashtable name to create. |
20
| <N> | The initial number of hashtable items. |
21 1 Per Amundsen
22
*Example*
23
24 3 Per Amundsen
<pre>
25 1 Per Amundsen
; call the setup once
26
; /example
27
;
28
; //echo -a $abbr(lol)
29
;
30
alias example {
31
  ;Create the table.
32
  /hmake abbr 1000
33
 
34
  ;Populate the table.
35
  /hadd abbr lol laughing out load
36
  /hadd abbr omg oh my gosh
37
  /hadd abbr lmao laughing my a?? off
38
  /hadd abbr brb be right back
39
}
40
; get the abbreviation
41
alias abbr return $hget(abbr, $1)
42 3 Per Amundsen
</pre>