Glenn Jackman wrote:
>
> [exec] takes arguments, the first of which is the external command to
> run. As you have only 1 arg to exec, it was trying to look for a
> program named "wish83.exe test-choice.tcl". Try:
> exec wish83.exe test-choice.tcl
OK
> Try this in your tcl console:
> package require Tk
> source test-choice.tcl
I also thought this could work, but actually this is not enough,
IxTclHal still cannot be used (my script starts with the command
"package require IxTclHal" which returns an error saying "cannot find
package"). Without that package I cannot run the rest of the
sub-scripts.
> Alternately, launch your wish program and read its stdout:
>
> set pipe [open "| wish83.exe test-choice.tcl" r]
> fileevent $pipe readable [list callback $pipe]
> vwait ::forever
>
> proc callback {chan} {
> if {[gets $chan line] > -1} {
> do something with $line
> } else {
> if {[eof $chan]} {
> puts "program has ended"
> set ::forever now
> }
> }
> }
Yes, this works really well! This is a very good solution for me.
Thank you so much.
Received on Sun Apr 30 02:08:46 2006