Page 1 of 1

code error i am angry offf

Posted: Fri Jun 09, 2006 7:44 am
by okanerkaymaz
dear friends
mr Ted send me .hoc file code but
that code don't run my pc
i use NEURON 5.9
CODE:
2.HOC
/*****************************
opensum=0
proc findopen{
opensum+=DDINa[0].O
print opensum
}

findopen()

{
xpanel("OKan sonuç",0)
xvalue("tplam Na=","findopen()")
xpanel()
}

/******************************
when i loaded my main.hoc file , Neuron showed a error message

this error message is folowing
error
/***********************************
oc>nrniv: syntax error
in 2.hoc near line 2
proc findopen{
^
xopen("2.hoc" )
NEURONMainMenu[0].execute1"{xopen("2.hoc")}" )
NEURONMainMenu[0].load_file0"./2.hoc" , )
NEURONMainMenu[0].load"*.hoc"0 , )

/********************************

Posted: Fri Jun 09, 2006 1:27 pm
by Raj
In my opinion there is nothing to be angry about.

What I see is that Ted put you in the right direction, with some good suggestions. It is up to you to put these back in to the context of your code and fix possible small mistakes in coding.

The proc findopen needs for example a few extra brackets, and should open as:

Code: Select all

proc findopen(){ 
I do not immediately see other mistakes, but you might get more error messages.

Also the code example you sent originally is not self-contained and cannot run on its own. You can therefore not expect that suggestions for a change are in anyway tested for syntactical correctness.