pass &gkbar_hh to a func

Anything that doesn't fit elsewhere.
Post Reply
pfortier
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?

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

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.
test(&gkbar_hh)
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:
test(&dend.gkbar_hh(z))
dend test(&gkbar_hh(0.5))
dend test(&gkbar_hh(z)) // assuming that 0 <= z <= 1
dend {
. . . hoc statements . . .
test(&gkbar_hh(0.5))
. . . hoc statements . . .
}

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

Post Reply