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.
local strdef?
-
- 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
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
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.
/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
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.