Hi,
I'm new to Tcl and have been trying to write a relatively simple program. I'm running WindowsXP and have Tcl 8.4.9 installed from ActiveState. I was having troubles with the program I had so I simplified the problem down to this.
# START
catch {console show}
set i 1;
fconfigure stdout -buffering none
while {$i <= 1400} {
puts stdout "Current val of i:"
puts stdout $i
flush stdout;
incr i
}
puts stdout "done!"
# FINISH
At this point that is all I'm trying to run. The problem is, when I run this script the computer just sits there for a few seconds with the hour glass turning and then prints out the last few hundred lines to the console in one burst. What I want though is to see all 1400 numbers being printed out in real time. I added the fconfigure and flush stdout lines to see if they helped but they didn't. From what I understand, stdout is supposed to be line buffered by default anways. I also ran the script on Suse 9.2 and it printed them out correctly. Is there an issue with Windows or is there something simple I'm missing? Thanks a lot. I appreciate it.
-Sean
I'm new to Tcl and have been trying to write a relatively simple program. I'm running WindowsXP and have Tcl 8.4.9 installed from ActiveState. I was having troubles with the program I had so I simplified the problem down to this.
# START
catch {console show}
set i 1;
fconfigure stdout -buffering none
while {$i <= 1400} {
puts stdout "Current val of i:"
puts stdout $i
flush stdout;
incr i
}
puts stdout "done!"
# FINISH
At this point that is all I'm trying to run. The problem is, when I run this script the computer just sits there for a few seconds with the hour glass turning and then prints out the last few hundred lines to the console in one burst. What I want though is to see all 1400 numbers being printed out in real time. I added the fconfigure and flush stdout lines to see if they helped but they didn't. From what I understand, stdout is supposed to be line buffered by default anways. I also ran the script on Suse 9.2 and it printed them out correctly. Is there an issue with Windows or is there something simple I'm missing? Thanks a lot. I appreciate it.
-Sean