A code that works on the interpreter but not in a hoc file!
Posted: Wed Oct 11, 2006 7:40 am
Hi everybody!
I have this little piece of code within a hoc file:
Whenever I run the file, it gets interrupted with the message:
nrniv: rvm not an array variable
in C:/(...blahblahblah...)/longIclamp.hoc near line 128
for m=0, n-2 rvm[m] = new RangeVarPlot("v")
HOWEVER, I can comment the block, get the hoc file loaded and then type each command in the interpreter and they get correctly executed, without any error message! (I have already tried putting the block at the end of the hoc file, so there are no commands that have to be executed before).
How can that be possible?
Some background: the term[0] section has its RangeVarPlot defined in other part of the code. The code that I am presenting here is within a if(n>1) block (n being the number of term sections, and will be normally 4)
Regards
I have this little piece of code within a hoc file:
Code: Select all
objref rvm[n-1]
for m=0, n-2 rvm[m] = new RangeVarPlot("v")
for m=0, n-2 term[m+1] rvm[m].begin(0)
for m=0, n-2 axon rvm[m].end(1)
for m=0, n-2 sgraph.addobject(rvm[m], m+2, 2)
nrniv: rvm not an array variable
in C:/(...blahblahblah...)/longIclamp.hoc near line 128
for m=0, n-2 rvm[m] = new RangeVarPlot("v")
HOWEVER, I can comment the block, get the hoc file loaded and then type each command in the interpreter and they get correctly executed, without any error message! (I have already tried putting the block at the end of the hoc file, so there are no commands that have to be executed before).
How can that be possible?
Some background: the term[0] section has its RangeVarPlot defined in other part of the code. The code that I am presenting here is within a if(n>1) block (n being the number of term sections, and will be normally 4)
Regards