If I define the following list:
set ::listofvariablesn [list {"inputfile" "Input file"}]
set ::inputfile "Somefile or numbers"
I can check if the variable ::inputfile exists using:
foreach a $::listofvariablesn {
if {[info exists ::[lindex $a 0]]} {
puts "Ok"
}
}
But I cannot access the value of ::inputfile using:
foreach a $::listofvariablesn {
if {[checkvl "Input file" $::[lindex $a 0] 1 0 0 0]} {
puts "Ok"
}
}
I got the error: can't read "::": no such variable
Is there a way to get this substitution done? I mean turn $::[lindex $a 0] into $::inputfile so I can access the value of ::inputfile
Thanks a lot