---- '''Contents:-''' * What's The Difference Between "==" And "eq"? ---- * '''Back/Home''' to the.....: [Answered Questions Index Page] * '''Forward''' to................: [Answered Questions On: The Tk GUI] * Ask '''New Questions''' at: [Ask, and it shall be given # 3] ---- '''WHAT'S THE DIFFERENCE BETWEEN "==" AND "EQ"?''' MG April 22nd 2004 - Out of pure curiousity, what (if anything) are the pros and cons of using these different checks in an if {} statement? if { $str1 == $str2 } { # do something } if { $str1 eq $str2 } { # do something } if { [string equal $str1 $str2] } { # do something } Peter Newman 26 April 2004: I have a Perl background; so have always assumed that "==" is for numbers and "eq" is for strings. So:- if { "01" == "1" } should return TRUE, and; if { "01" eq "1" ) should return FALSE. But looking at the expr manpage, who knows? And I'm too lazy to fire up wish and check it out. But I always code on that assumption, and haven't yet encountered anything that suggests it's wrong. Also, I think "eq" is relatively new (Tcl 8.3 for example). So perhaps that explains the apparently redundant [string equal $str1 $str2]. But don't quote me on any of this. MG Apr 28 2004 - I just checked that in wish, and it seems you're absolutely right. Thanks for the help :)