0 Favourites

How do I Get Multi Select from Listbox to a String [SOLVED]

  • Hi

    I know this should be easy but annoyingly it is getting the better of me . Basically I have a list of words held in a listbox and when (the listbox is set to multi select) more than one word is selected I need to add this to a string variable and each word (but not the last one) needs to be separated by a comma and then the last word needs to be separated by the word and .

    So at the moment this is triggered by a listbox on clicked (I have also tried on select change as well) and then I have added a sub event from this with the condition listbox.selectedcount>1 then using a for loop add each selected word to the variable adding a comma on the end but no words are added when I do this.

    Is my logic correct ? If so it must be how I am going about this. This is a large project to add as a capx file as there are other event sheets involved here doing other work within the project but if someone could point me in the right direction I would appreciate it

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Got this solved, when I was trying to add the last word instead of appending onto my variable I was infact clearing it leaving it to only put and but then the last word was still not being added after that.

    However I have solved this now, got other problems within the same part where it is not clearing these words if the selection is changed and I think its leaving the and sometimes on the end when it should not.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)