Notifications
Clear all

[Closed] access parameters in CA

I want to assign paramater in my own CA
here’s my CA define

testcaDef = attributes "testCa"
 (
 	fn dispatch =
 	(
 		for i = 1 to objAry.count do
 		(
 			if matchpattern objAry[i].name pattern:"*01" do obj1 = objAry[i]
 			if matchpattern objAry[i].name pattern:"*02" do obj2 = objAry[i]
 		)			
 	)
 	parameters testP 
 	(
 		objAry type:#nodeTab tabSize:0 tabSizeVariable:true
 		obj1 type:#node
 		obj2 type:#node
 		
 		on objAry set obj do dispatch()
 	)	
 )

now i know i can use

$.testCa.objAry[1] = XXX

to let it auto asignment obj1 and obj2.

but i don’t know…How to acess objAry in dispatch function.
I think it maybe like…

testP.objAry.count

but seems not …

2 Replies
 PEN

Just a scope issue, place the function below the Param block then place just declare the function above so it is in scope of the set handler. Then you can actress the parameters directly with he need for accessing the ca def.

Thanks Pen !
World is beautiful because of you.!