Notifications
Clear all

[Closed] listbox to multilistbox Help

Hi everybody
i have a question to change a listbox to a multilistbox in a script

here the script

rollout test "" height:200	width:150
  (
  	multilistbox mul_lis "" items:#("AA","text01","mmm","12345678")
  	button kk ">>>>"
  
  	
  on kk pressed do
  (
  --1
  	for j in 1 to mul_lis.items.count do
  	(
  	TheFile=mul_lis.items[j]	
  	print thefile						--it print all the items in the list but i need selected not all
  	thefile2=mul_lis.selection[j]	
  	print thefile2					--it turns true or false
  	)
  --2	
  	Arr=(mul_lis.selection) as string
  	print arr								--it turns sth like this	"#{3..4}"	
  --3
  	Arr2=(mul_lis.selection) as array
  	print arr2							--it turns the numbers of the items as array
  )		
  	
  )
  createdialog test

and the question is if the above snif was a listbox so i could say

Ar1=mul_lis.selected 
  Print Ar1

then I’ll have the name of selected listbox items, but in a multilistbox i try above but i couldn’t find any similar result for the selected items
i mean when you select some of the multilistbox items and press a button i get the name of the selected items.

any help is so appreciated

Thanks in advance

2 Replies
 
 on kk pressed do
 (
selNames = for i in mul_lis.selection collect mul_lis.items[i] 
 print selNames
)

Thanks a lot man
yeah that was the answer