section as parameter for procedure
Posted: Fri Jan 07, 2011 4:10 pm
I want to create a procedure that will do some tests on a section. Here is fake code (it does nothing meaningful) with the least code to highlight the problem.
This returns an error because I'm sending cell.soma as an object. I would need to send only cell for it to work but that defeats the purpose of having my testsection() procedure. I thought I could have testsection() represent $o1 as cell.soma and then use this to have:
$o1 { +code to adjust properties of section+ }
$o1.v(0.5) // access section range
Is there a way to do this? If not as 1 parameter, can I send cell and soma as 2 seperate parameters and then "paste" them together as in the dot referencing?
Code: Select all
proc testsection() { localobj mysection
mysection=$o1
}
objref cell
cell = new celltemplate() // template contains soma and dend[99]
access cell.soma
testsection(cell.soma)
$o1 { +code to adjust properties of section+ }
$o1.v(0.5) // access section range
Is there a way to do this? If not as 1 parameter, can I send cell and soma as 2 seperate parameters and then "paste" them together as in the dot referencing?