Forum Discussion
Dan_103700
Nimbostratus
Mar 11, 2011Nested Conditionals and NOT conditionals
Hi there,
I've been meaning to ask for awhile how to do nested conditionals and use a "not" operator in iRules.
I frequently end up writing iRules that look like this:
if...
hoolio
Cirrostratus
Mar 11, 2011TCL operator precedence should be the same as most other languages. So the ! or not takes precedence over the starts_with string evaluation.
http://www.tcl.tk/man/tcl8.4/TclCmd/expr.htmM6
if { {$foo starts_with "bar" or $bar ends_with "foo"} and {$baz == 5} } {
->
if { ($foo starts_with "bar" or $bar ends_with "foo") and ($baz == 5) } {
if { { {not $foo starts_with "bar"} or $bar ends_with "foo"} and {$baz == 5} } {
->
if { ( not ($foo starts_with "bar") or $bar ends_with "foo") and $baz == 5 } {
Aaron
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
