Ticket #3571: AIO AutoIt Test Script.au3

File AIO AutoIt Test Script.au3, 1001 bytes (added by TheDcoder <TheDcoder@…>, 7 years ago)

Reproducer script (attaching for archival purposes)

Line 
1Dim $mMap[]
2
3; Generate random key strings
4For $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
10next
11
12
13ConsoleWrite("-----------1-------------" & @CRLF); Unpredictable blank values
14
15MapDisplay1($mMap)
16
17ConsoleWrite("-----------2-------------" & @CRLF); ByRef always works
18
19MapDisplay2($mMap)
20
21ConsoleWrite("-----------3-------------" & @CRLF); not in a function always works
22
23For $i In MapKeys($mMap)
24    isMap($mMap[$i])
25    ConsoleWrite($i&": "&$mMap[$i]&@CRLF)
26Next
27
28
29Func 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
34EndFunc
35
36Func 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
41EndFunc