Dear tek-tips,
I'm sorry I am very much a beginner with tcl and scripting in general.
I am working with a program, written with C++ and tcl, which opens a modified tcl shell when it runs. I can change variables, and execute functions in the C++ program by typing tcl commands at the prompt.
The problem is this: I would like to execute a function repeatedly, changing some variables with each iteration.
This code sort of works:
set myvariable 0
for {set i 1} {$i < 10} {incr i 1} {
myfunction execute
after 5000 {set myvariable $i}
vwait myvariable
}
However, the timing is not always right. I would like for myfunction to finish executing before myvariable is reset and the loop is repeated.
I hope this makes sense!
Thanks for your help,
erae
I'm sorry I am very much a beginner with tcl and scripting in general.
I am working with a program, written with C++ and tcl, which opens a modified tcl shell when it runs. I can change variables, and execute functions in the C++ program by typing tcl commands at the prompt.
The problem is this: I would like to execute a function repeatedly, changing some variables with each iteration.
This code sort of works:
set myvariable 0
for {set i 1} {$i < 10} {incr i 1} {
myfunction execute
after 5000 {set myvariable $i}
vwait myvariable
}
However, the timing is not always right. I would like for myfunction to finish executing before myvariable is reset and the loop is repeated.
I hope this makes sense!
Thanks for your help,
erae