Thank you for the report.
Turns out, the remove function was "broken" for removing nested arrays.
Fixed it, and upgraded it in the process. Now your method will work.
However, it is no longer necessary, I overloaded the add function.
You can now use it to set values up to the 10th dimension.
Ex:
Code:
Arr := AHKASet(Arr, "NewValue", 5, 2, 9, 1, 4)
; Arr[5][2][9][1][4] = "NewValue";
New version (5.41) is available for download.
Also, I've updated the docs to match the capability.
Also, here's my test file in case there's something I might have missed in testing...
Code:
#MaxThreadsPerHotkey 1
#MaxThreads 1
#SingleInstance force
Test:
; Create New 3-Dimensional Array :: [A, B, [C1, C2], D, [E1, [E2i, E2ii, E2iii], E3], F]
myarr := AHKANewArray()
myarr := AHKAAdd(myarr, "A")
myarr := AHKAAdd(myarr, "B")
temp := AHKANewArray()
temp := AHKAAdd(temp, "C1")
temp := AHKAAdd(temp, "C2")
myarr := AHKAAdd(myarr, temp)
myarr := AHKAAdd(myarr, "D")
temp := AHKANewArray()
temp := AHKAAdd(temp, "E1")
temp2 := AHKANewArray()
temp2 := AHKAAdd(temp2, "E2i")
temp2 := AHKAAdd(temp2, "E2ii")
temp2 := AHKAAdd(temp2, "E2iii")
temp := AHKAAdd(temp, temp2)
temp := AHKAAdd(temp, "E3")
myarr := AHKAAdd(myarr, temp)
myarr := AHKAAdd(myarr, "F")
; Lets Change The "D" to a "D+"
myarr := AHKASet(myarr, "D+", 4)
result := AHKAGet(myarr, 4)
MsgBox, %result%
; Lets Change The "C1" to a "C1+"
myarr := AHKASet(myarr, "C1+", 3, 1)
result := AHKAGet(myarr, 3, 1)
MsgBox, %result%
return
#Include AHKArray.ahk