I am trying to implement a general cross-correlation GUI where the user types in the variable names to be cross-correlated. I have two problems.
1) How can I make a field where the user can type the name of the variable? Alternatively, how can I interface with the variable window that comes up in the "Plot What?" of a graph to obtain variables/ variable names?
2) Given a user-defined variable as just described, how can I then use it in cvode.record()? The problem is that I can hard-code a variable name in hoc code, but I do not see a way to have the first parameter dynamically assigned.
Thanks,
Tom
Variable names as variables
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
You want to use a SymChooser.1) How can I make a field where the user can type the name of the variable? Alternatively, how can I interface with the variable window that comes up in the "Plot What?" of a graph to obtain variables/ variable names?
http://www.neuron.yale.edu/neuron/stati ... SymChooser
2) Given a user-defined variable as just described, how can I then use it in cvode.record()? The problem is that I can hard-code a variable name in hoc code, but I do not see a way to have the first parameter dynamically assigned.
So don't hard code it. Use sprint
http://www.neuron.yale.edu/neuron/stati ... tml#sprint
to assemble the command string you want, then use execute
http://www.neuron.yale.edu/neuron/stati ... ml#execute
to execute that string.
Here's a general strategy for how to find answers in the Programmer's Reference:
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=554