array variable in template
Posted: Fri Aug 26, 2011 10:45 pm
I made a template that creates a soma as an array variable:
where mytest.hoc contains:
This code works just fine, printing out:
However, if I now move the contents of mytest.hoc into the main file to get the following:
I get an error:
How can I make the code work directly in the template file?
Code: Select all
begintemplate grr
proc init() {
load_file("mytest.hoc")
}
endtemplate grr
objref mycell
mycell = new grr()
quit()
Code: Select all
create soma[5]
for i = 0, 4 soma[i] {
print i
}
print soma[0].L
Code: Select all
0
1
2
3
4
100
Code: Select all
begintemplate grr
proc init() {
create soma[5]
for i = 0, 4 soma[i] {
print i
}
print soma[0].L
}
endtemplate grr
objref mycell
mycell = new grr()
quit()
Code: Select all
/home/casem/neuron/nrn/x86_64/bin/nrniv: soma not an array variable
in testy.hoc near line 6
for i = 0, 4 soma[i] {
^