Project

General

Profile

Hmake » History » Version 3

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