Notifications
Clear all

[Closed] using string tab

I’ve decided I want to go the stringTab route.
But how do I read this stringTab back in as an actual array with so I can manipulate its parts.


plugin simpleObject Info 
name:"Info"
category:"Standard Primitives"
classID:#(0x14efefc5, 0x1769dde9)
(
	parameters main rollout:sets
	(
		setList type:#stringTab tabSize:0 tabSizeVariable:true -- changed the parameter name also changed tabsize to 0 so it would not add an undefined item to the array		
		
		on setList tabChanged change tabIndex tabCount do
		(
			this.sets.ui_num.text = setList.count as string
			this.sets.PopulateList()
-- 			if change == #refDeleted then
-- 				deleteItem setList tabIndex
-- 			else this.sets.PopulateList
		)
	)
	
	rollout sets "Sets"
	(
		multilistbox ui_SetList items:#() height:8
		button ui_AddObject "Add New" height:25 width:50 across:3
		button ui_Remove "Remove" height:25 width:45 offset:[6,0]
		button ui_ClearList "Clear" height:25 width:45 offset:[4,0]
		button ui_Print "Print StringTab" width:140 height:25
		label lbCount "Count:" across:2
		label ui_num "0"
		
		fn PopulateList =(
			print setList[1]
-- 			ui_SetList.items = for n in setList collect n.index
-- 			ui_SetList.selection = #{}
		)
		
		on ui_AddObject pressed do 
		(
			id = (setList.count + 1)
			item = #((id),(random 0.0 1.0),(random 0 100)) as string
			append setList item
		)
		
		on ui_ClearList pressed do (setList = #())
		on ui_Print pressed do (print setList)
	)
	
	tool create
	(
		local first_pos
		
		on mousePoint click do case click of
		(
			1: (coordSys grid (nodeTM.translation = first_pos = gridPoint))
			2: #stop
		)
	)
)



Page 2 / 2