opening data files with variable names
Posted: Tue Jul 18, 2006 9:13 am
Hi,
Is there a way to open a file whose name is determined by a variable that I set? i.e., i have many data files that have this naming scheme:
GLUT_path_1.dat
GLUT_path_2.dat
GABA_path_1.dat
GABA_path_2.dat
etc.
and in every simulation i need to change the path number that is used
so instead of changing the path numbers in every data file i open in my hoc file, I would like to just set a variable to do this, something like:
i = 2
objectvar glutfile
glutfile = new File()
glutfile.ropen("GLUT_path_i.dat")
objectvar gabafile
gabafile = new File()
gabafile.ropen("GABA_path_i.dat")
Is there a way to do this? It would be extremely convenient..thanks!
Rita
Is there a way to open a file whose name is determined by a variable that I set? i.e., i have many data files that have this naming scheme:
GLUT_path_1.dat
GLUT_path_2.dat
GABA_path_1.dat
GABA_path_2.dat
etc.
and in every simulation i need to change the path number that is used
so instead of changing the path numbers in every data file i open in my hoc file, I would like to just set a variable to do this, something like:
i = 2
objectvar glutfile
glutfile = new File()
glutfile.ropen("GLUT_path_i.dat")
objectvar gabafile
gabafile = new File()
gabafile.ropen("GABA_path_i.dat")
Is there a way to do this? It would be extremely convenient..thanks!
Rita