So neither cm nor i_cap is automatically known to code within an NMODL-defined mechanism. No problem. Only needs a few minor additions to what I have already recommended.
Add these declarations to the NEURON block of the NMODL code for your synaptic mechanism:
RANGE cm : set equal to cm in relevant segment
POINTER icap : link to i_cap in relevant segment
All that remains is to use the necessary hoc statements to assign a value to cm and link icap to i_cap in the segment to which the synaptic mechanism is attached. So consider the completely arbitrary example of a synaptic mechanism that is an instance of the class Whatever (i.e. the mechanism's NEURON block declares POINT_PROCESS Whatever) attached to the middle of a section called erewhon:
Code: Select all
objref syn
erewhon {
syn = new Whatever(0.5)
syn.cm = cm(0.5)
setpointer syn.icap, i_cap(0.5)
}
And you're off to the races.