---- * '''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.] ---- '''Answered Questions On: Basic Tcl...''' ---- on 17/08/2004 How can I see the value of some tcl environment varialbe at tcl prompt which I set through C program (using Tcl_Setvar) Manu 17/8/04 [MG] - Looking at the man page for Tcl_SetVar, it looks as if, if you did... Tcl_SetVar('','somevar','value') In your C code, then you could (in your Tcl code) call the variable with either of $somevar set somevar With '$somevar' and 'set somevar' being the equiv. of the C Tcl_GetVar() function, and 'set somevar value' the equiv. of the C Tcl_SetVar(). ---- '''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 :)