Array key unexpectedly converted to int
Posted: 05 May 2021, 22:27
For some reason AHK appears to be interpreting one of my array keys as an integer despite being a string:
9223372036854775807 is the maximum integer size for 64-bit, so not only is it the wrong value but data is probably being lost.
Code: Select all
keys := ["0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF01"
,"01234567890123456789012345678901234567890123456789"]
a := []
a.push( {keys[1] : "value1"} )
a.push( {keys[2] : "value2"} )
loop % a.length()
for key , val in a[A_Index]
str .= key . "`n"
msgbox % str
; output:
; 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF01 (good)
; 9223372036854775807 (bad)