Forum Discussion
Michael_Hunzike
Nimbostratus
Mar 11, 2005Problem with elseif
Okay, this is driving me nuts...I'm trying to get a simple nested if statement working and it's not....
This works:
when HTTP_REQUEST
{
if {[HTTP::host] eq...
unRuleY_95363
Mar 11, 2005Historic F5 Account
line 14: [command is not valid in the current scope][}]
This error implies you had an extra close brace "}" at the outer most scope (the same indent level as the "when"). Perhaps when you selected the code and left off the opening "rule rastak {" you still picked up the closing brace.
Generally, Tcl requires all commands arguments to be on the same line. However, the components of a list may be spread across multiple lines.
We did not feel this syntax adequately allowed users that were used to 4.x rules to continue to use the indent styles they were used to in 4.x. So we modified the Tcl language to be more forgiving with the if command (and for the most part it is). However, when we made this modification we did not account for extra whitespace that might be at the end of the previous line. This is likely the issue you encountered with the elseif argument. We are fixing this, so please be patient.
Additionally, we have been working hard on a GUI rule builder that will make writing some of the simpler rules far more easy.
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
