local strdef?

Anything that doesn't fit elsewhere.
Post Reply
jaambros
Posts: 29
Joined: Tue Oct 04, 2005 3:29 pm
Location: Ohio University

local strdef?

Post by jaambros »

Is there a chance to have a local strdef, e.g, localstr ?

local variables (local and localobj) are great when writing templates.
However strings are only global and can get in the way in a complex template.
ted
Site Admin
Posts: 6394
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

"local strdef" workaround: String class + localobj

Post by ted »

The standard run system
/usr/local/nrn/share/nrn/lib/hoc/stdlib.hoc
or
c:\nrn\lib\hoc\stdlib.hoc
contains a lot of useful stuff, including the definition of a String class.
The latter is just a wrapper for a strdef--see

Code: Select all

begintemplate String
 . . .
endtemplate String
in stdlib.hoc for particulars. That plus localobj lets you work around the
absence of a localstr. If you prefer not to use the standard run system,
just steal the String class definition and use it with your own code.
Post Reply