Page 1 of 1

"bad stack access"

Posted: Mon May 08, 2006 11:08 am
by udi
hi all,

I'm using the following code:

objref vvec, tvec ,vx, i1, i2
vvec = new Vector()
tvec = new Vector()

tvec.record(&t)
soma vvec.record(&v(0.5),tvec)

i1 = tvec.indvwhere(">=", t1) //t1, t2 are defined elsewhere
i2 = tvec.indvwhere("<=", t2)

vx = vvec.c(i1+1, i2)

When I run the simulation the following errors appears:

bad stack access: expecting (double); really (Unknown)
nrniv: interpreter stack type error

What is the problem ?

Thanks in advance,

--Udi.

Re: "bad stack access"

Posted: Mon May 08, 2006 4:50 pm
by ted
Rather than give you a fish, here's how to fish.

If you can't just look at the code and quickly see what's wrong, try one of these
strategies:
1. Insert print statements and see if the error message appears before or after
the message is printed. This only works for run-time errors; it will not work for
syntax errors, which crop up when the code is parsed.
2. Comment out blocks of code until the error message disappears. Then uncomment
code in small increments until you find out what triggers the error message.

So give one or both of these strategies a try and see if you can discover (or at least
localize) the cause of the problem. Once you know where it is, the cure may jump out
at you.