Polymorphism - Making TCL operators work for you
Is there a functional difference between comparison operators such as "ne, eq, != and =="? What really is the difference between "ne" and "!="? What about "eq" and "=="? When should you use one versu...
Published Apr 15, 2008
Version 1.0Colin_Walker_12
Historic F5 Account
Joined May 12, 2005
Colin_Walker_12
Historic F5 Account
Joined May 12, 2005
Andy_Herrman_22
Nimbostratus
Apr 16, 2008Here's another simple example that shows the difference between == and eq.
[code]
set x 5
if { $x == 5 } { } this evaluates as true
if { $x eq 5 } { } this evaluates as true
if { $x == 05 } { } this evaluates as true
if { $x eq 05 } { } this evaluates as false
[/code]
== and eq will treat leading 0s in a value differently. == will basically ignore them, while eq won't, as eq treats it as part of the string.