Hello,
This may be a similar problem to the previous post, but I am creating a new post since the previous post didn't seem to solve my problem.
I have trouble with oepening hoc files. When I double click a hoc files, the program runs fine. However, when I open the same file in a different way (e.g. File-load hoc or right click the icon of the hoc file and choose nueron.exe), there is an error message which says other hoc files can't be found. This is not convenient, but is something I can live with.
However, I also use a different PC. On this PC, I accidentally chose hoc files to be opened with Wordpad when its icon is double clicked. Then, I can't open the hoc file at all since right click and choosing neuron.exe or File-load hoc doesn't work either.
This seems to be a some kind of path problem as suggested in the previous post. But, I couldn't find how to fix this problem. I appreciate your help.
Best regards,
Daisuke
Can't open hoc files
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Can't open hoc files
What version of NEURON are you using?dtakeshita wrote:I have trouble with oepening hoc files. When I double click a hoc files, the program runs fine. However, when I open the same file in a different way (e.g. File-load hoc or right click the icon of the hoc file and choose nueron.exe), there is an error message which says other hoc files can't be found.
Exactly what is the error message? (you can copy and paste it into the Forum)
Do you mean that you "told" MSWin to use Wordpad to open hoc files?However, I also use a different PC. On this PC, I accidentally chose hoc files to be opened with Wordpad when its icon is double clicked. Then, I can't open the hoc file at all since right click and choosing neuron.exe or File-load hoc doesn't work either.
-
- Posts: 3
- Joined: Sun Jun 26, 2011 7:20 am
Re: Can't open hoc files
The version is 7.1. When I try to open a hoc file from "File-load hoc", I get the following error message, while when I double click the same hoc file the code runs fine.ted wrote:What version of NEURON are you using?
Exactly what is the error message? (you can copy and paste it into the Forum)
Code: Select all
oc> 1
nrniv: syntax error
in current.hoc near line 18
insert spike
^
xopen("current.hoc" )
NEURONMainMenu[0].execute1("{xopen("current.hoc")}" )
NEURONMainMenu[0].load_file(0"./Users/Takeshita_Daisuke/Documents/Programming/NEURON 7.1/myCode/myModel/ver2_00/ver2_00/current.hoc" , )
NEURONMainMenu[0].load("*.hoc"0 , )
Never mind about the 2nd problem in my previous post. After I set a default program back to Neuron.exe, the code runs fine by double clicking the hoc file. But, I still cant't open the hoc file using "File-load hoc" or right clicking the icon and choosing Neuron.exe, which is the same problem as above. When I open the hoc file by right clicking the icon and choosing Neuron.exe, I get the following error message:
Code: Select all
1
nrniv: syntax error
in C:/Users/Takeshita_Daisuke/Documents/Programming/NEURON 7.1/myCode/myModel/ver2_00/ver2_00/current.hoc near line 18
insert spike
Daisuke
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Can't open hoc files
Looks to me like NEURON doesn't know about the "spike" mechanism when you use File / load hoc
Which suggests that the directory that contains the nrnmech.dll file is not your current working directory.
What OS are you using? MSWin 7? Some other version of MSWin? or something else?
How are you navigating to the directory that contains your hoc file? Are you using
NEURON Main Menu / File / working dir
?
When you get to the working directory, does NEURON print any messages to its xterm window? It should say something like
"loading mechanisms from . . . "
Which suggests that the directory that contains the nrnmech.dll file is not your current working directory.
What OS are you using? MSWin 7? Some other version of MSWin? or something else?
How are you navigating to the directory that contains your hoc file? Are you using
NEURON Main Menu / File / working dir
?
When you get to the working directory, does NEURON print any messages to its xterm window? It should say something like
"loading mechanisms from . . . "
-
- Posts: 3
- Joined: Sun Jun 26, 2011 7:20 am
Re: Can't open hoc files
I didn't know I needed to set the working directly. So, the problem is solved now. I am sorry for having bothered you with a stupid quesiton.
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Can't open hoc files
The only stupid question is the question that isn't asked.
If you start NEURON by double clicking on a hoc file, the working directory is the directory that the hoc file is in. If a nrnmech.dll file is in that directory, NEURON reads it before it reads the hoc file.
If you start NEURON by double clicking on the nrngui icon, the working directory is c:\, which isn't very useful because nobody would ever want to put their hoc, ses, or nrnmech.dll files in c:\ (and MSWin won't let ordinary users save files in c:\ anyway, at least not since Win 2K).
If you use
File / working dir
to select a working directory, NEURON will look in that directory for nrnmech.dll. And NEURON will save the name of this directory in a list. The next time you start NEURON you will be able to click on
File / recent dir
and select the directory from that list.
If you start NEURON by double clicking on a hoc file, the working directory is the directory that the hoc file is in. If a nrnmech.dll file is in that directory, NEURON reads it before it reads the hoc file.
If you start NEURON by double clicking on the nrngui icon, the working directory is c:\, which isn't very useful because nobody would ever want to put their hoc, ses, or nrnmech.dll files in c:\ (and MSWin won't let ordinary users save files in c:\ anyway, at least not since Win 2K).
If you use
File / working dir
to select a working directory, NEURON will look in that directory for nrnmech.dll. And NEURON will save the name of this directory in a list. The next time you start NEURON you will be able to click on
File / recent dir
and select the directory from that list.