1 | Dim $mMap[] |
---|
2 | |
---|
3 | ; Generate random key strings |
---|
4 | For $i = 0 To 100 |
---|
5 | $RndKey = "" |
---|
6 | For $i2 = 0 To 4 |
---|
7 | $RndKey &= Chr(Random(65,90,1)) |
---|
8 | Next |
---|
9 | $mMap[$RndKey] = 999 |
---|
10 | next |
---|
11 | |
---|
12 | |
---|
13 | ConsoleWrite("-----------1-------------" & @CRLF); Unpredictable blank values |
---|
14 | |
---|
15 | MapDisplay1($mMap) |
---|
16 | |
---|
17 | ConsoleWrite("-----------2-------------" & @CRLF); ByRef always works |
---|
18 | |
---|
19 | MapDisplay2($mMap) |
---|
20 | |
---|
21 | ConsoleWrite("-----------3-------------" & @CRLF); not in a function always works |
---|
22 | |
---|
23 | For $i In MapKeys($mMap) |
---|
24 | isMap($mMap[$i]) |
---|
25 | ConsoleWrite($i&": "&$mMap[$i]&@CRLF) |
---|
26 | Next |
---|
27 | |
---|
28 | |
---|
29 | Func MapDisplay1( $m_Map ) |
---|
30 | For $i In MapKeys($m_Map) |
---|
31 | isMap($m_Map[$i]) ;same problem with isMap($m_Map[$i]), MapKeys($m_Map[$i]), MapAppend/MapRemove but NOT with MapExists($m_Map,$i) |
---|
32 | ConsoleWrite($i&": "&$m_Map[$i]&@CRLF) |
---|
33 | Next |
---|
34 | EndFunc |
---|
35 | |
---|
36 | Func MapDisplay2( ByRef $m_Map ) |
---|
37 | For $i In MapKeys($m_Map) |
---|
38 | isMap($m_Map[$i]) |
---|
39 | ConsoleWrite($i&": "&$m_Map[$i]&@CRLF) |
---|
40 | Next |
---|
41 | EndFunc |
---|