charmdream
Programmer
After" works fine in wish, but doesn't work in tclsh.
Anybody had this experience? How to solve it?
Thanks
Anybody had this experience? How to solve it?
Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set time 10000
proc callback { {n "0"}} {
global time
incr time $time
after $time; return [incr n]
}
set i 0
while {1} {
set i [callback $i]
puts "Time is now $time at $i"
set time [expr $time / 2]
puts -nonewline stdout "Want to quit(y/n): "
flush stdout ; set ans [gets stdin]
if {"$ans" == "y"} {break}
puts "time = $time"
}
after $time; puts $msg
if {[catch {package require Expect}]} {
if {[catch {package require Tclx}]} {
error "Couldn't load either package for fork()"
}
}
set time 12000
set wrote 0
proc calltime {} {
global time wrote
puts "\nTime UP!!!!\n"
after $time; calltime
}
if {[set id [fork]] == 0} {
calltime
} else {
while {1} {
puts -nonewline stdout "Quit this process(y/n): "
flush stdout
set ans [gets stdin]
if {"$ans" == "y"} {exit}
}
}