home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / tcl / 1184 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.2 KB  |  41 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!gatech!darwin.sura.net!convex!rdavis
  3. From: rdavis@convex.com (Ray Davis)
  4. Subject: Re: insertion of non-formated strings
  5. Message-ID: <rdavis.713726071@connie.de.convex.com>
  6. Sender: usenet@convex.com (news access account)
  7. Nntp-Posting-Host: connie.de.convex.com
  8. Organization: CONVEX Computer Corporation, Richardson, Tx., USA
  9. References: <1992Aug12.215321.2136@terminator.cc.umich.edu>
  10. Date: Thu, 13 Aug 1992 17:14:31 GMT
  11. X-Disclaimer: This message was written by a user at CONVEX Computer
  12.               Corp. The opinions expressed are those of the user and
  13.               not necessarily those of CONVEX.
  14. Lines: 25
  15.  
  16. normanb@citi.umich.edu (David R. Richardson) writes:
  17.  
  18. >What is the proper way to operate on strings that might not
  19. >be well formatted -- strings that might contain quotations,
  20. >braces, spaces, etc.?
  21.  
  22. >foreach i [exec scan] {
  23. >    .frame.list insert end $i
  24. >}
  25.  
  26. Try this...
  27.  
  28.     set fd [open "| scan" r]
  29.     while {![eof $fd]} {
  30.     gets $fd line
  31.     if {[string length $line]} {
  32.         .ls.list insert end $line
  33.     }
  34.     }
  35.     close $fd
  36.  
  37. Are you doing the very thing I've been thinking of?  Making a
  38. tk based tool for mh?  Maybe we can share ideas.
  39.  
  40. Ray
  41.