Page 1 of 1

pass a section as an argument

Posted: Tue Jun 12, 2007 10:44 am
by vdhelm
Another syntax question:
Can I pass a section as an argument to a procedure?
I have written a procedure to link two cells by gap junctions, but it seems, that sections are not treated as objects.

Code: Select all

objref gapj[2]
proc insertgapj() { //args: 1.segment, 1.pos, 2.segment, 2.pos
  $o1 gapj[0] = new gGap($2)
  setpointer gapj[0].vgap, $o3.v($4)
  $o3 gapj[1] = new gGap($4)
  setpointer gapj[1].vgap, $o1.v($2)
}
insertgapj(cell[0].dend[1], 0.8, cell[1].dend[1], 0.8)
When I execute this code, it says "stack empty".

Thanks for helping
Martin

Posted: Wed Jun 13, 2007 7:18 am
by vdhelm
Ah! Just dicovered SectionRef().
So I think I can manage it now. ;)