I am working in a TCL automation environent at my workplace. I'm trying to run a delayed command in my script using "after". The problem i encounter is that when i try to specify commands with variables inside a code block under an "after" , the vars are not recognized and i get an error message. I'll quote the relevant parts of the code.
proc test_script1 {{bh0 0} ...more vars....} {
.
.
.
after [expr 20000] {
set some_value[ ns1::probe_TCP_connections $bh0 $main_duration 1 15] }
puts "the value i got is $some_value"
}
And i seem to get an error: can't read "some_value": no such variable
Can anyone suggets what is the problem , and how to oversome it? thx
afteris made to run at the designated delay while continuing with the script. Soputs "the value i got is $some_value"is being executed before the variable is set. Additionally, yoursetinside theafterblock looks suspicious.