Collect items not selected in Mulitlist box array

Collect items not selected in Mulitlist box array

Anonymous
Not applicable
610 Views
2 Replies
Message 1 of 3

Collect items not selected in Mulitlist box array

Anonymous
Not applicable

Hi 

I am stuck..I have spent the morning to try and solve something which I know should be super easy

 

I want to collect items not selected from a Multilist box..

Can anyone point me in the right direction?

 

To select the items I have

 

selectedServers = (for i in serverlist_selection collect rlt_ServerList.lst_ServerList.items[i])
local sel = rlt_ServerList.lst_ServerList.selection as array

for o = 1 to sel.Count do
(
server = rlt_ServerList.lst_ServerList.items[sel[o]]
)

 

any assistance would be great as it is driving me nuts!

0 Likes
Accepted solutions (1)
611 Views
2 Replies
Replies (2)
Message 2 of 3

Swordslayer
Advisor
Advisor
Accepted solution

Invert the .selection bitarray:

 

try destroyDialog mlbSample catch()
rollout mlbSample "Multilistbox sample"
(
	multiListBox mlbTest items:(for i in #{1..20} collect i as string)
	button btnPrintInverse "Print Inverse"

	on mlbSample open do
		mlbTest.selection = for i = 1 to 20 by random 1 3 collect i

	on btnPrintInverse pressed do
		print (for i in -mlbTest.selection collect mlbTest.items[i]) #noMap
)
createDialog mlbSample
0 Likes
Message 3 of 3

Anonymous
Not applicable

thanks

never thought to try -.selection

 

That works!

 

0 Likes