Posted to tcl by mjanssen at Sun Aug 26 20:04:57 GMT 2007view raw

  1. proc doexec {} {after 2000}
  2. fconfigure stdin -buffering line
  3. proc dostep {} {
  4. doexec
  5. after idle {after 0 dostep}
  6. }
  7. proc get {} {
  8. gets stdin data
  9. puts $data
  10. puts -nonewline "% "
  11. flush stdout
  12. }
  13. puts -nonewline "% "
  14. flush stdout
  15.  
  16. fileevent stdin readable get
  17. dostep
  18. vwait forever