Syntax errors in HOC
Posted: Sat Aug 22, 2015 11:51 am
I am having difficulties debugging some HOC code that I am working with. When I run the code, I get the following error message:
I cannot figure out what is wrong with either "s = 0" or "inodes[s].e_extracellular = Out". These two lines fall within the integrate procedure (see below). When I try adding print statements for debugging purposes, none of them are actually executed. Any insights into how I should proceed would be thoroughly appreciated. Thank you!
Code: Select all
nrniv: syntax error
in ModelB.hoc near line 311
s = 0
^
xopen("ModelB.hoc" )
execute1("{xopen("ModelB.hoc")}" )
load_file("C:/Users/Username/Documents/Lab - Data/Nerve Simulations/Models/ModelB.hoc" )
0
nrniv: syntax error
in ModelB.hoc near line 324
inodes[s].e_extracellular = OutCode: Select all
//Integrates the model
proc integrate() {
while (t<tstop) {
if(t > 1 && t < 1+stimtime){
n = 0
m = 0
s = 0
flag = 0
for i = 0,nodes*11-11{
flag = 0
n = n+1
if(n == 1){
assignExt(i,1,1)
node[m].e_extracellular = Out
flag = 1
}
if(n == 2){
assignExt(i,Ran,Rax)
inodes[s].e_extracellular = Out
s = s+1
flag = 1
}
if(n == 11){
assignExt(i,Rax,Ran)
inodes[s].e_extracellular = Out
s = s+1
flag = 1
}
if(flag == 0){
assignExt(i,Rax,Rax)
inodes[s].e_extracellular = Out
s = s+1
flag = 1
}
if(n == 11){
n = 0
m = m+1
}
}
}
if(t > 1+stimtime){
n = 0
m = 0
s = 0
flag = 0
for i = 0,nodes*11-11{
flag = 0
n = n+1
if(n == 1){
assignExt(i,1,1)
node[m].e_extracellular = 0
flag = 1
}
if(n == 2){
assignExt(i,Ran,Rax)
inodes[s].e_extracellular = 0
s = s+1
flag = 1
}
if(n == 11){
assignExt(i,Rax,Ran)
inodes[s].e_extracellular = 0
s = s+1
flag = 1
}
if(flag == 0){
assignExt(i,Rax,Rax)
inodes[s].e_extracellular = 0
s = s+1
flag = 1
}
if(n == 11){
n = 0
m = m+1
}
}
}
fadvance()
if(writetofile == 1){
for i =0,nodes-1{
//savv.printf("%f \n",node[i].v) //Uncomment this part if you want to save the voltage profile for each trial, this slows down the process significantly but can useful to gain an sense of what is going on
}
}
//Checks nodal segments for presence of significant depolarization (action potential). Checks both middle segments as well as segments further down the axon on both sites to make sure that the action potential propagates
if(writetofile == 1 && (node[int(nodes/2)-2].v > -25 || node[int(nodes/2)-1].v > -25 || node[int(nodes/2)].v > -25 || node[int(nodes/2)+1].v > -25)){
result[0] = 1
}
if(writetofile == 1 && node[int(nodes/2)-6].v > -25){
result[1] = 1
}
if(writetofile == 1 && node[int(nodes/2)+6].v > -25){
result[2] = 1
}
}
}