Forum Discussion
Ten_92952
Nimbostratus
Apr 29, 2011irule question
Would someone be able to tell my why the syntax for this irule is acceptable to the BigIp
when RULE_INIT {
Purpose:
This rule allows the ace servers access to the acme we...
Hamish
Cirrocumulus
Apr 29, 2011Short answer is because the first is syntactically correct, but the second isn't... It's missing the block of something to do.
In languages like C or perl, you could put a ';' in place to denote what is essentially a no-op... But tcl doesn't have that syntax... It's expecting something to do. And 'else' isn't a valid 'something to do'. It's part of the control itself. It's also IMO bad practice to write code such that an evaluation results in a NOOP and you have an else there instead (Sorry, comp sci education coming out in me again).
A better syntax (If you really don't want to do anything from the if{} statement is to negate the test. Then you don't need the else {} at all.
H
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
