Hi there,
I have something weird happening to me and i have no clue where to go....
My situation: I have 3 strings. If either $str1 and $str2 or $str2 and $str3 match, I set a flag and continue but i have totally different string contents and my if clause still returns true... huh???
My code looks like this:
and this is what I get in my text widget ($GUI::twidget): ***MATCH***str1:temperature = str2:>memrw 3 ||str2:>memrw 3 = str3:
isn't that weird? Can any one explain what's happening here?
I also checked the strings' length to make sure there's no unprintable characters that match but the sizes look like this:
len1: 11
len2: 8
len3: 0
figured out with
I'm very thankful for any hints or suggestions!
Thanks,
Ron
I have something weird happening to me and i have no clue where to go....
My situation: I have 3 strings. If either $str1 and $str2 or $str2 and $str3 match, I set a flag and continue but i have totally different string contents and my if clause still returns true... huh???
My code looks like this:
Code:
if { ([string compare -length 7 $str1 $str2] == 0) || ([string compare -length 2 $str2 $str3]) } {
set cond 0
$GUI::twidget insert end "\n\n***MATCH***str1:$str1 = str2:$str2 ||str2:$str2 = str3:$str3\n\n"
}
isn't that weird? Can any one explain what's happening here?
I also checked the strings' length to make sure there's no unprintable characters that match but the sizes look like this:
len1: 11
len2: 8
len3: 0
figured out with
Code:
set len1 [string length $str1]
set len2 [string length $str2]
set len3 [string length $str3]
I'm very thankful for any hints or suggestions!
Thanks,
Ron