Forum Discussion
AndyC_86542
Nimbostratus
Oct 10, 2008Syntax help needed (very basic)
I want to assign the result of a comparison to a local variable. I keep getting "Invalid command name". This is the minimum code to show the problem:
set param "wibble"
set result [[HTTP::uri] contains $param]
Any ideas what I am missing.
2 Replies
- hoolio
Cirrostratus
Hi there,
The []'s execute the code within. They're like backticks (`) in *nix. You can use 'expr' (Click here) or 'if' instead:
set result [expr {[HTTP::uri] contains $param}]
orif {[HTTP::uri] contains $param}{ set result 1 } else { set result 0 }
Aaron - AndyC_86542
Nimbostratus
Excellent. That makes total sense now. Thanks.
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
