Page 1 of 1

Problem with fscan (SOLVED)

Posted: Wed Mar 25, 2020 12:33 pm
by AngeSurTerre
I'm new in the neuroscience field and the Neuron software, so my problem might be dumb. I have a file "Values.dat" that contains a list of numerical values. I was able to create this file by creating an object File() and then using the printf function. Now I want to be able to read from this file, which as I understand can be done by using the fscan function. Here is a test code that I wrote:

Code: Select all

objref MyFile
MyFile=new File()

for (i=0;i<10;i=i+1) {
    print Value

From the documentation I read and from my Google searches, it seems that I'm using the fscan function properly. However when I run the code, I get the error message:
fscan not a public member of File
nrniv: File fscan
in Test.hoc near line 8
What am I doing wrong?

Re: Problem with fscan

Posted: Wed Mar 25, 2020 3:10 pm
by ramcdougal
fscan is a function used for a single file opened with the ropen function (File.ropen is different).

If you are instead using the File class, then you'll want the scanvar method instead.

Re: Problem with fscan

Posted: Wed Mar 25, 2020 3:13 pm
by AngeSurTerre
Perfect, that fully solves the problem!
Thank you!