Page 1 of 1

Issues with underscores in variable or procedure names

Posted: Sun Sep 14, 2014 8:29 pm
by nikkip
Hi Ted,

I use underscores in almost all of my variable/procedure/function names. But I've just recently that sometimes these underscores make NEURON crash. For instance:

Code: Select all

proc batchrun() {
	print "testing 1"
}
batchrun()

proc batch_run() {
	print "testing 2"
}
batch_run()
The first procedure runs fine, but the second crashes. Is this because there is a hidden built-in variable or function called "_run" that's conflicting somehow? And if that's the case, is there a list of such key words that should be avoided in conjunction with variable/function/procedure names?

Thanks!

Nikki

Re: Issues with underscores in variable or procedure names

Posted: Mon Sep 15, 2014 9:33 am
by nikkip
Interesting... If you replace batch_run() with batch_gun(), it works fine. So some conflict with the built-in run() function?

Re: Issues with underscores in variable or procedure names

Posted: Mon Sep 15, 2014 12:07 pm
by ted
batch_run() is a reserved name--look it up in the Programmer's Reference. Any attempt to redefine batch_run() should generate a syntax error message.