I have a variable that exists or not depending to my inputs
so i have made a if :
if { [info exists $var1] } {
puts "Here we are, Born to be kings, We're the princes of the universe ..."
}
but when i launch my script, i get the error log :
can't read "var1": no such variable
while executing
"info exists $var1"
What’s the mistake ?
use
if { [info exists var1] } {...The variables are replaced before the call is made, and
infois no exception. So pass the name of the variable instead of it’s value.