home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / tcl / 2453 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!europa.asd.contel.com!awds.imsd.contel.com!andy
  3. From: andy@awds.imsd.contel.com (Andy Moskoff)
  4. Subject: Bug in Tcl_CommandComplete ?
  5. Message-ID: <1993Jan22.164743.6007@awds.imsd.contel.com>
  6. Organization: GTE Federal Systems, Westlake Village, CA
  7. Date: Fri, 22 Jan 1993 16:47:43 GMT
  8. Lines: 23
  9.  
  10.  
  11. Fellow TCLers:
  12.  
  13. I want to be able to pipe a tcl script into wish and sometime later from
  14. another program (maybe C) send commands to the wish interpreter. For example:
  15.  
  16.  (cat tcl_script; my_program) | wish. (NOTE: tcl_script set up a Text widget
  17.  
  18. and my_program issued text commands to standard output.)
  19.  
  20. This never really worked though. After tracing through a lot of wish code,
  21. we determined that Tcl_CommandComplete was returning 1 even though a partial
  22. command was present. For example, ".w insert end {abc}\n.w" was considered
  23. a complete command, because it was at the end of the command buffer! Note:
  24. we modified StdinProc to do a fread of BUFSIZ, NOT a fgets. So, any time
  25. the piped script stradled the command buffer boundary, the error 
  26. "ambiguous command .w" appeared.
  27.  
  28. If anybody has a solution to 1) doing what I want to do conceptually or 2)
  29. a fix to the tcl code I would appreciate hearing from you. 
  30.  
  31.  
  32. -Andy
  33.