How do I get the indices of selected items in listbox

Get help using Construct 2

Post » Mon Aug 04, 2014 1:26 am

I'm using list box and multiselect is on, how do i get all the indices of the selected items as this is more than 1, .selected count only returns the number of items selected and not the index
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Mon Aug 04, 2014 1:54 am

Make a For Loop:

For "" from 0 to list.count + 1 (i'm not sure why, but I had to add +1 to get the last index)

then, I'm not sure what you're doing with it, but I was just putting them into some text like this:
append List.SelectedTextAt(loopindex)
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Mon Aug 04, 2014 6:36 am

@spacedoubt, thanks, i guess it should be .itemcount not .count. Thanks once again
spacedoubt wrote:Make a For Loop:

For "" from 0 to list.count + 1 (i'm not sure why, but I had to add +1 to get the last index)

then, I'm not sure what you're doing with it, but I was just putting them into some text like this:
append List.SelectedTextAt(loopindex)
B
15
S
4
Posts: 138
Reputation: 2,003


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests