pass &gkbar_hh to a func

Anything that doesn't fit elsewhere.
Post Reply
Posts: 47
Joined: Thu Apr 20, 2006 8:02 am
Location: University of Ottawa

pass &gkbar_hh to a func

Post by pfortier »

If I define param=4 then I can pass it's address to a function test(&param) but it fails when I try to pass &gkbar_hh as in test(&gkbar_hh) and test(&soma.gkbar_hh). Is there a way to pass the address of a RANGE variable?

Site Admin
Posts: 5771
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: pass &gkbar_hh to a func

Post by ted »

To pass a range variable by reference, the location to which it refers must be specified unambiguously.
will fail for at least one reason: it doesn't specify a location in the range [0,1]. If there is no currently accessed section, it will also fail for a second reason (i.e. hoc can't guess which section you mean).

These examples will work:
dend test(&gkbar_hh(0.5))
dend test(&gkbar_hh(z)) // assuming that 0 <= z <= 1
dend {
. . . hoc statements . . .
. . . hoc statements . . .

If a default section has been specified with an access statement, e.g.
access soma
will work and the particular "gkbar_hh(0.5)" that proc test() receives will be the one that belongs to soma.

Post Reply