tomdagliusa
Programmer
If I predefine a var, and try to switch on it's value, it doesn't work.
tcl>set x "10.1.1.1"
tcl>puts $x
10.1.1.1
tcl>set y $x
tcl>puts $y
10.1.1.1
I would like to know if y is equal to x:
tcl>switch -exact -- $y {
=>$x {puts "x"}
=>2 {puts "2"}
=>default {puts $y}
=>}
10.1.1.1
Even though y and x are both "10.1.1.1", they don't
equate within the switch, but they will outside the
switch:
tcl>if {$x == $y} {
=>puts "yes"
=>} else {
=>puts "no"
=>}
yes
???,
Tom
tcl>set x "10.1.1.1"
tcl>puts $x
10.1.1.1
tcl>set y $x
tcl>puts $y
10.1.1.1
I would like to know if y is equal to x:
tcl>switch -exact -- $y {
=>$x {puts "x"}
=>2 {puts "2"}
=>default {puts $y}
=>}
10.1.1.1
Even though y and x are both "10.1.1.1", they don't
equate within the switch, but they will outside the
switch:
tcl>if {$x == $y} {
=>puts "yes"
=>} else {
=>puts "no"
=>}
yes
???,
Tom