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

Just started using Construct 2? Post your questions here

Post » Sun Jan 22, 2017 5:52 pm

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
Last edited by timcs on Sun Jan 22, 2017 9:25 pm, edited 1 time in total.
Regards

TimCS
B
22
S
8
Posts: 119
Reputation: 1,870

Post » Sun Jan 22, 2017 9:25 pm

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.
Regards

TimCS
B
22
S
8
Posts: 119
Reputation: 1,870


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests