Forum Discussion
Deb_Allen_18
May 22, 2005Historic F5 Account
use of {} as text delimiter
Here's a case where I've used {} as a delimiter. It seems to work, but I was wondering if it was legal usage of {}s and whether there was a better way:
HTTP::redirect "http://host.dom.com/sub/index.jsp?id=a0a0a&pid=${in_pid}&ptype=list"
The variable is followed directly by additional text with no natural delimiter, so I wanted to delimit the variable name, but double quotes around the variable would terminate the redirect string prematurely.
(Actually as it turns out, the character trailing the variable name is a &, which seems to delimit the name naturally. If an alpha-numeric follows the variable name, I get an undefined variable error. I can't find a documentation reference on that, so it seemed safest to delimit it somehow. I should at least know the proper way to do so.... =+)
thanks again for the great info
/deb
1 Reply
- unRuleY_95363Historic F5 AccountYes, Tcl allows the use of braces {} as a variable name delimiter. As a matter of fact, if your variable name contains any non-alphanumeric characters (other than an underscore), you will have to use braces around the variable name.
For example, you can use a hyphen in your variable name as in:set my-really-cool-name "Pooh Bear" log "My name is: ${my-really-cool-name}"
However, the use of the hyphen will require the use of braces on all the variable references.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects