Polymorphism - Making TCL operators work for you
Published Apr 15, 2008
Version 1.0Was this article helpful?
[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.