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 strongm 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. crossrad

    (unix) Change execution terminal/console

    If you are running wish rather than tclsh and xauth is set up so that "send" will work, then perhaps you could do this: - run "wish" in the other terminal or console. - note the appname of it - do "winfo name ." to find out. It will be either wish or...
  2. crossrad

    Unicode problems/differences between TCL8.0 and 8.3 - please help

    I tried running the following script which writes files of ascending, descending and random character codes, and then reads them back in to check. Results: 8.3.3 - no errors 8.0p2 - 8.0.4 - many errors, which on further investigation are due to the fact that...
  3. crossrad

    Good book/ online guide for beginner.

    I would recommend "Tcl/Tk Programmers Reference" by Christopher Nelson. It starts a very concise description of the syntax and then covers each of the commands with plenty of tips and examples. This mirrors the structure of the language.
  4. crossrad

    Obejet Oriented Programing Problem

    Problem 1: ToolbarFile is an object not a class. "Files" are not significant in Tcl as regard scope, so if you have created the object at global scope (i.e. not within another object or namespace) then [ToolbarFile hide] should work. If it was created in a namespace or another...
  5. crossrad

    How to search for a string!

    proc grep {pattern filename} { set fp [open $filename] for {set found 0} {![eof $fp] && !$found} {} { set found [regexp $pattern [gets $fp]] } close $fp return $found } Example usage: if {[grep {abc} file1.txt]} { puts "OK" } else { puts...
  6. crossrad

    Returning a list from a command????

    tclsh % proc report_names {args} { return [list abcd tom vicky Mary] } % set namelist [report_names -spec {ABC }] abcd tom vicky Mary % set namelist abcd tom vicky Mary The list is copied to the terminal when the set command is issued because the result of the set command itself is the...
  7. crossrad

    Is it possible to return an array ??

    The short answer is no. In order to make your code efficient, Tcl forces you to pass arrays to procedures by reference. This simply means that the procedure has a parameter which the name of the array, and the procedure uses "upvar" to access it. However you can return lists from...
  8. crossrad

    upgrading from tcl 7.6 to 8.2 .

    Watch out if you are using "scan" and a format string including "%x" to parse hex values above 0x7FFFFFFF (assuming 32 bit hardware). Up to 8.0, these were translated to negative integers; in 8.1 and 8.2 all such values are mapped to 0x7FFFFFFF - I don't like this!
  9. crossrad

    Creating tclIndex files for procs exported from namespaces

    In TCL 8.0, tclIndex files created by auto_mkindex<br> contained procedure names which were NOT qualified with<br> their namespace prefixes. Therefore, if these were public,<br> exported commands then the autoloader worked just fine.<br> <br> In TCL 8.1 and 8.2, the tclIndex files contain...
  10. crossrad

    Passing command-line arguments to Tcl

    The command line arguments are available inside a script<br> as global variables:<br> <br> argv0 is the name of the script<br> argv is a list of the arguments<br> argc is the number of arguments<br> (equal to [llength $argv])<br> <br> Hence the following script should print...
  11. crossrad

    How can I convert a character to its ascii hex code?

    How about:<br> <br> set ch &quot;A&quot;<br> scan $ch &quot;%c&quot; i<br> puts $i

Part and Inventory Search

Back
Top