Code: Select all
forall for i=0,n3d()-1 fprint("%f %f %f %f\n", x3d(i), y3d(i), z3d(i), v(i))
Code: Select all
for i=0, all-sections()
for j =0, n3d() -1
fprint("%f %f %f %f\n", x3d(i), y3d(i), z3d(i), v(i))
Stephan
Code: Select all
forall for i=0,n3d()-1 fprint("%f %f %f %f\n", x3d(i), y3d(i), z3d(i), v(i))
Code: Select all
for i=0, all-sections()
for j =0, n3d() -1
fprint("%f %f %f %f\n", x3d(i), y3d(i), z3d(i), v(i))
Code: Select all
forall {
for i=0,n3d()-1 {
fprint("%f %f %f %f\n", x3d(i), y3d(i), z3d(i), v(i))
}
}[/quote]You might find this helpful:
[url]http://www.neuron.yale.edu/neuron/static/new_doc/programming/hocsyntax.html[/url]
Code: Select all
objref all_sections
all_sections = new SectionList()
total_sections = 0
forall { all_sections.append() }
forall { total_sections = total_sections + 1 }
Code: Select all
j = 10
if (j < total_sections) {
access all_sections[j];
// do something
}
Code: Select all
i = 0
forall {
if (i<NUM) do whatever
i+=1
}
Code: Select all
objref first10
first10 = new SectionList()
i = 0
forall {
if (i<10) first10.append()
i+=1
}
Code: Select all
forsec first10 whatever
Code: Select all
objref srlist
srlist = new List()
forall srlist.append(new SectionRef()) // for each section
// create a new SectionRef that refers to that section
// and append that SectionRef to srlist
Code: Select all
for i = 2,5 srlist.o(i).ref {
statements that refer to variables that belong to sections 3-6
}
Code: Select all
access section_of_interest
for i=0, n3d()-1 {
// do something
}