Forum Discussion
gerald_wegener_
Nimbostratus
Aug 28, 2006Possible to use SWITCH with variable
Is it possible to use switch to do the following using variables?
I've been trying for a while but can't get it to work using SWITCH.
-------
X = some random number say 50
A =10
B =4
C =6
----------
if { $X > $A } {
pool pool01
}
if { $X <= $B } {
pool pool02
}
if { (($X > $B) and ($X <= $A)) } {
pool pool3
}
Thank you for your help.
2 Replies
- Deb_Allen_18Historic F5 AccountI'm not sure "switch" is the right command for the job...
"switch" is useful when you want to react to equality with known values or patterns, but since you are instead evaluating inequalities, I think what you have is more appropriate.
HTH
/deb - gerald_wegener_
Nimbostratus
I didn't see a way I could use SWITCH but wanted to double-check. Thank you.
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