Is there a way to get a list of Objects of a certain type?
Say I create a Foo object, that becomes Foo[0], I create a second, and third, Foo[1] and Foo[2], then delete the second so I now have Foo[0] and Foo[2].
Is there a way to discover the existence of Foo[0] and Foo[2]?
The closest I can see is the SymChooser, but that's a GUI tool and doesn't seem to do what I need.
Testing if an Object ID exists
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Testing if an Object ID exists
Read about allobjects() in the Programmer's Reference.
Re: Testing if an Object ID exists
Thanks that does the trick.
One more question though, is hoc_stdio the only way to capture the output of the function?
http://www.neuron.yale.edu/neuron/stati ... #hoc_stdio
It does the job but I wouldn't mind something a bit cleaner than writing temporary files.
One more question though, is hoc_stdio the only way to capture the output of the function?
http://www.neuron.yale.edu/neuron/stati ... #hoc_stdio
It does the job but I wouldn't mind something a bit cleaner than writing temporary files.
Re: Testing if an Object ID exists
Since you know the type you can say
objref xxx
xxx = new List("type")
for i=0, xxx.count-1 print xxx.o(i)
objref xxx
xxx = new List("type")
for i=0, xxx.count-1 print xxx.o(i)