Forum Discussion
Issues with Table Lookup command
You can verify if the table lookup is returning anything by adding a simple logging line:
if {[table lookup -notouch $l7table] eq "" } {
table set $l7table 1 3
} else {
log local0. "Table lookup:[table lookup -notouch $l7table]"
table incr -notouch $l7table
}With regards to your comment about which type of equals to use, TCL doesn't distinguish between variable types, everything is a string. How you use an operator is key. For example 'eq' will always compare two strings whereas '==' is polymorphic, it will decide which type is appropriate and convert the variable if required. This can have a performance impact so best practice is to have a good idea about the data you are interrogating and write code appropriately. You can read more about this here:
Polymorphism - Making TCL operators work for you.
But in a nutshell, using eq or == should have the same result, one may be more expensive than the other depending on the type of variable be interrogated.
Lee
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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