Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. AviaTraining

    Scan a photo with TCL/TK code

    If you're working on Windows, you might want to look into the XBit extension, which includes a TWAIN API. I've not used it myself, so I can't really provide any more details than what you're find at the XBit home page, http://www.geocities.com/~chengye/soft.html. - Ken Jones, President...
  2. AviaTraining

    Listbox Binding (this s/b simple)

    You certainly found a workable solution. In case you're still a bit hazy on how the bindtags command works, you can take a quick look at my replies in Thread287-211083. Given that additional background, you can probably figure out what's happening in your case... Most widget functionality is...
  3. AviaTraining

    Zooming In on a Canvas (Line) Item

    Ah. Now I see your dilemma. For all but the most simple of cases, I wouldn't try to replicate BLT's graphing features with the canvas if at all possible. But yes, using Prowrap with BLT is quite problematic. I see at least three possible ways to approach this: Use TclKit technology instead of...
  4. AviaTraining

    Zooming In on a Canvas (Line) Item

    The canvas is an incredible widget, with more fascinating features than most people are aware of. However, it does have some limitations, and an easy method for "zooming" the view without actually scaling all the objects is one of them. (The ability to rotate objects is another big missing...
  5. AviaTraining

    expr

    ulis basically explained what you're experiencing. For more information on this -- as well as how to work around it -- go to the Tcl'ers Wiki (http://wiki.tcl.tk) and check out the page "Tcl and octal numbers," http://wiki.tcl.tk/498. There is a TIP (Tcl Improvement Proposal) to remove this...
  6. AviaTraining

    buffering, eof, read quirks

    Nope, it's correct as written. Note how len gets set: catch {gets $sock line} len So catch stores the error message generated in len if an error occurs, or the return value of gets if there is no error. (I'll address what gets returns in a moment.) We then test the return value of catch in the...
  7. AviaTraining

    buffering, eof, read quirks

    I don't know exactly what your C program is doing, but I suspect you don't want to keep closing and reopening the pipe. Keep in mind that when you open a pipe in Tcl, the open actually starts the other program running and connects up the pipe channels for you to use. So if you do something like...
  8. AviaTraining

    Search/Replace in tcl HELP!

    Check out the string map command (introduced in Tcl 8.1.1). It does exactly what you want: it takes a list mapping input character patterns to output character patterns and a string to process, and returns the result of the replacement process. For example: set translation { red...
  9. AviaTraining

    buffering, eof, read quirks

    Just a note that you'll detect an EOF condition only when the pipe closes. (And even then, Tcl's eof command returns True only if the previous attempt to read from the channel via gets or read detected an EOF condition.) Flushing the channel doesn't close the channel, it just sends any data that...
  10. AviaTraining

    Listbox with varying bkgd and frgd colors from row to row

    There is some rudimentary support for this with the listbox widget. Check out the listbox itemconfigure operation, and the various attributes that you can set on a per-item basis. However, this isn't particularly robust, especially if you're updating the contents of the listbox frequently. In...
  11. AviaTraining

    List part of command

    The quick and dirty answer: eval button .exit $list The eval command concatenates all of its arguments, exactly like the Tcl concat command, and then executes the result. But be aware that there are dangers lurking in eval for the uncautious. Check out my response in thread287-727277...
  12. AviaTraining

    TCL online documentation wanted

    True, but it's simply an alias to the http://www.tcl.tk site. And I'm pretty sure that the company that acquired Scriptics won't be renewing the domain when it expires. At that time, it'll probably be snapped up by one of the countless domain name squatters who'll either try to sell it, or (more...
  13. AviaTraining

    TCL online documentation wanted

    Just to clarify Breadcrust's comment, in case people are unaware, Scriptics was acquired by another company 3 years ago, which discontinued support for all Tcl-related products and services. A shame, because I'd happily still be working there otherwise. But the new, canonical URL for the Tcl...
  14. AviaTraining

    exec can't find files

    Well, here is an area where Tcl doesn't make it as easy as it could. The exit code of an exec'ed program is available, but not in a straightforward manner. When an error occurs in Tcl, it stores values in a couple of pre-defined global variables. One of those is errorInfo, which gets a stack...
  15. AviaTraining

    stop tcl from taking over with errors from other apps

    Oops. I typed the wrong command name. It isn't bgerror, but bgexec. At least I gave the correct Wiki page link. - Ken Jones, President, ken@avia-training.com Avia Training and Consulting, www.avia-training.com 866-TCL-HELP (866-825-4357) US Toll free 415-643-8692 Voice 415-643-8697 Fax
  16. AviaTraining

    Is this a valid expect statement?

    No, because the expect command doesn't have a return value -- or more precisely, always has an empty string return value -- and so you have an invalid boolean expression for your while command. What you're trying to do is actually fairly easy with the exp_continue command. When used in the body...
  17. AviaTraining

    exec can't find files

    As a side note, once you start working with eval, you have to be really careful managing your arguments. In your above example, let's assume that: set searchTag "some string" set file_list "file1.txt file2.txt" Now, the result of the string concatenation of the following...
  18. AviaTraining

    stop tcl from taking over with errors from other apps

    As you've discovered, when working with pipelines in Tcl, you can encounter an error condition if:one of the programs in the pipeline exits with a non-zero exit code, orone of the programs writes to its standard error (stderr) channel and you don't explicitly redirect stderr when you create the...
  19. AviaTraining

    Permutations & Combinations in Tcl??

    The Tcler's Wiki (http://wiki.tcl.tk) is a great place to look for utilities like this. Read through some of the "welcome" pages to get a feel for the place, and then just start searching. I quickly came up with the following page: "Combinatorial mathematics functions,&quot...
  20. AviaTraining

    how to use power operator, like x^y?

    There's a much easier way. For over 10 years (since Tcl 7.0), expressions have supported the pow() function. pow() accepts 2 floating-point arguments, like pow($x,$y), which would raise x to the y power: % set x 2 2 % expr { pow($x, 2) } 4.0 % expr { pow($x, 10) } 1024.0 % expr { pow($x, 5.75)...

Part and Inventory Search

Back
Top