pass a section as an argument

The basics of how to develop, test, and use models.
Post Reply
vdhelm
Posts: 4
Joined: Fri Jun 01, 2007 5:50 am
Location: University of Munich

pass a section as an argument

Post 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
vdhelm
Posts: 4
Joined: Fri Jun 01, 2007 5:50 am
Location: University of Munich

Post by vdhelm »

Ah! Just dicovered SectionRef().
So I think I can manage it now. ;)
Post Reply