euras wrote:
Lets say the tool gather some type of information first, then gather second type information and I want to have it all in a one
mother array. That's the method I'm using and it works.
I think you are trying to make a
constructor to build your own custom object but you are unclear about the object your want to build
I see 4 output possibilities firstA, firstB, firstC or firstD.
Code: Select all
firstA:=[["SKG","text1"],["SKS","text2"],["SKP","text3"]]
firstB:=[["text1","SKG"],["text2","SKS"],["text3","SKP"]]
firstC:=[{"SKG":"text1"},{"SKS":"text2"},{"SKP":"text3"}]
firstD:=[{"text1":"SKG"},{"text2":"SKS"},{"text3":"SKP"}]
msgbox, % "firstA:`n" . st_printarr(firstA)
msgbox, % "firstB:`n" . st_printarr(firstB)
msgbox, % "firstC:`n" . st_printarr(firstC)
msgbox, % "firstD:`n" . st_printarr(firstD)
;String Things by tidbit
;https://autohotkey.com/boards/viewtopic.php?f=6&t=53&sid=5c401643235e7a2e73d769f1e5deac0f
st_printArr(array, depth=5, indentLevel="")
{
for k,v in Array
{
list.= indentLevel "[" k "]"
if (IsObject(v) && depth>1)
list.="`n" st_printArr(v, depth-1, indentLevel . " ")
Else
list.=" => " v
list.="`n"
}
return rtrim(list)
}