Page 1 of 1

prompt for string from standard input?

Posted: Sat Jun 30, 2007 12:25 pm
by abogaard
I want to dynamically assign folder names for the data files I spit out after simulations.

So far I have used xred to set numerical parameters, but I would like something analogous for strings and havent found it... when used in my hoc file, getstr defaults to the loaded file and tried to grab the next line of code from the file rather than breaking for my input.

Thanks much,
Andrew

Also, I thoroughly enjoyed meeting everyone last week and will surely cross paths again.

Re: prompt for string from standard input?

Posted: Sat Jun 30, 2007 9:52 pm
by ted
The NEURON course is always a lot of work for all who are involved, but also
a lot of fun because everybody learns new (and often useful) stuff.
abogaard wrote:I want to dynamically assign folder names for the data files I spit out after simulations.
By "dynamically" do you mean "interactively"?
And by "folder names" do you mean "file names"?

Posted: Tue Jul 03, 2007 1:56 pm
by abogaard
I already dynamically assign file names based on changing parameters during the run, but I hope to interactively create folders before each run. I realize I could just hardwire a strfoldername in there and manually assign it before I hit run, but theres a programmer part of me thats frustrated and stubborn to figure this out.

Andrew

Posted: Tue Jul 03, 2007 6:49 pm
by ted
Have you considered using the TextEditor class?
http://www.neuron.yale.edu/neuron/stati ... tedit.html
Or perhaps you might find inspiration in lib/hoc/stdrun.hoc's
proc save_ses_nrnmainmenu()
or
proc change_working_dir()