Forum Discussion
Frank_J_104756
Nov 04, 2009Historic F5 Account
comparing variable values
I have 4 counter variables that are set. I've incremented them based on the of times certain strings are seen in an array. I now need to compare these 4 different variables so that I can find out w...
hoolio
Cirrostratus
Nov 05, 2009Also, make sure to use lindex 0 to get the lowest value as TCL lists are 0 indexed.
when RULE_INIT {
set var0 4
set var1 3
set var2 2
set var3 1
set var4 0
log local0. "Sorted: [lsort -integer [list $var0 $var1 $var2 $var3 $var4]]\
-> lowest: [lindex [lsort -integer [list $var0 $var1 $var2 $var3 $var4]] 0] "
}
Log output:
: Sorted: 0 1 2 3 4 -> lowest: 0
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
