variable names and data types
Posted: Wed Mar 18, 2009 10:00 am
I have a couple of questions about the following hoc code and a modified version of it:
objectvar f, randx
f = new File()
f.ropen("randnums/rsx0.dat")
irand = f.scanvar()
randx = f.scanvar()
The code above, extracted from a larger program based on demofig1.hoc from patdemo.zip, gives the following error when I run the simulation from mosinit.hoc within a nrnzip file:
bad stack access: expecting (Object **); really (double)
nrniv: interpreter stack type error
The modified version of it below, however, does not give this error:
objectvar f
f = new File()
f.ropen("randnums/rsx0.dat")
irand = f.scanvar()
irandx = f.scanvar()
So it looks like randx is automatically declared as a double, whereas irandx is not. Is this correct?
I haven't been able to find information in the documentation about the rules concerning variable names and data types. Is there some documentation where really basic things like this are covered?
Thanks for your help...
ja
objectvar f, randx
f = new File()
f.ropen("randnums/rsx0.dat")
irand = f.scanvar()
randx = f.scanvar()
The code above, extracted from a larger program based on demofig1.hoc from patdemo.zip, gives the following error when I run the simulation from mosinit.hoc within a nrnzip file:
bad stack access: expecting (Object **); really (double)
nrniv: interpreter stack type error
The modified version of it below, however, does not give this error:
objectvar f
f = new File()
f.ropen("randnums/rsx0.dat")
irand = f.scanvar()
irandx = f.scanvar()
So it looks like randx is automatically declared as a double, whereas irandx is not. Is this correct?
I haven't been able to find information in the documentation about the rules concerning variable names and data types. Is there some documentation where really basic things like this are covered?
Thanks for your help...
ja