Syntax error :(

Hi,
I am trying to put all the choices from my PopupMenu, into an array.

I have the following code, which has a syntax error somewhere in the middle line of code.
Even though I stepped away for an hour and then came back - I still cannot work out the correct syntax.

Can someone please advise me.

For i As Integer = 0 To Window1.PopupMenu1.ListCount -1 PopupMenuValuesArray.append(Window1.PopupMenu1.(i).Text) Next

Thank you all in advance.

Nope - I then get an error saying “Too many arguments - got 1, expected only 0”.

You have a dot between PopupMenu1 and i[/i] which you need to remove.

Thats what I just did - then I get the too many arguments error.

I have tried this:

For i As Integer = 0 To Window1.PopupMenu1.ListCount -1 PopupMenuValuesArray.append(Window1.PopupMenu1.(i).Text) Next

And this:

For i As Integer = 0 To Window1.PopupMenu1.ListCount -1 PopupMenuValuesArray.append(Window1.PopupMenu1(i).Text) Next

Sorry, getting tired. You are missing List:

PopupMenuValuesArray.append(Window1.PopupMenu1.List(i))

Thank you so much Eli.
That had me stumped for at least 2 hours!

Much appreciated.

PopupMenuValuesArray.append(Window1.PopupMenu1.List(i).Text)