I have tried some different approaches to this but I can't get it to work.
I have a string with many names delimited by a comma.
This string is then being parsed and pushed into a array.
The problem is that I can't get the information into the array. (I think)
This is the code:
Code: Select all
person := []
names := "alice,bob"
Loop, parse, names, `,
{
; This messagebox shows the data as it should
MsgBox, Name number %A_Index% is %A_LoopField%
person.Push(%A_LoopField%)
}
for index, element in person
{
;This messagebox does not show the data at all. I shows the correct index number, but not any content
MsgBox % "Element number " . index . " is " . element
}
What am I doing wrong?