Questions tagged [tcl]

Tool Command Language was invented by John Ousterhout as a way to make it easy to write little languages for configuring EDA tools, but it has grown far beyond those humble beginnings to become a general scripting language with built-in asynchronous I/O and Unicode strings while supporting paradigms such as object-oriented programming and coroutines.

Tool Command Language was invented by John Ousterhout as a way to make it easy to write little languages for configuring EDA tools, but it has grown far beyond those humble beginnings to become a general scripting language with built-in asynchronous I/O and Unicode strings while supporting paradigms such as object-oriented programming and coroutines. See the Wikipedia page for Tcl for more information.

The current recommended production release of Tcl is Tcl/Tk 8.6.11 (Dec 30, 2020).

Previous versions of the language are currently relatively common. Tcl 8.5 is widely deployed (current patch version 8.5.18). As is Tcl 8.4 in more conservative deployments (8.4.20 is current, but end-of-lifed there). Use of Tcl 8.4 or earlier is usually not recommended, as it does not receive security-fix support from the Tcl developers.

Naming

You may write the language name as either TCL or Tcl; practitioners tend to prefer the latter on the grounds that it means they don't have to hold the shift key down so long. For pronunciation purposes, either “tee cee ell” or “tickle” are acceptable, depending on audience.

Resources

Books:

Websites:

7056 questions
1
vote
1 answer

Using proc to duplicate parameters in Tcl

I want to make several objects, all with the same parameters, so I tried to store them in a proc that returns them. But the interpreter evaluates the returning result as one parameter, instead of several. my proc is: proc element_param {} { …
SIMEL
  • 8,246
  • 23
  • 76
  • 115
1
vote
1 answer

Tcl - Monitor FTP Upload percentage

How can I show the percentage of the upload handled by ::ftp::Put in Tcl? Example : proc upload {host user pass dir fileList} { set handle [::ftp::Open $host $user $pass] ftpGoToDir $handle $dir # some counters for our feedback…
yoda
  • 9,912
  • 19
  • 61
  • 90
1
vote
2 answers

the regular expressions in tcl

I have a question about regular expressions in tcl what does the following code means: set servRef "servRef=(\\d+)" set the variable servRef as "servRef=(\d+)"; what does this mean? the code following above one is to pass the servRef as a patarmer…
user707549
1
vote
2 answers

a question about expect and tcl

I have a question about expect/tcl, I expect the following expect "class room: classroom 1" send "classroom" send "classroom" will return "class room: classroom 1" but this does not match, because the expected matching become class room:…
user707549
1
vote
2 answers

Combine C and TCL using Swig

I have been following a tutorial to combine C with TCL using Swig. The tutorial seemed to be properly working but at the end I ran into an error that I cannot solve. The situation is as follows: The tutorial I was following…
Tom
  • 151
  • 1
  • 2
  • 4
1
vote
1 answer

How to add data to an element with ActiveState's dom package

In TCL, if you use the DOM package (available in the ActiveState distribution) you can create an xml. set xmlDoc [::dom::create] set root [::dom::document createElement $xmlDoc "trafficStatistics"] set statElement [::dom::document createElement…
Bogdan Gavril MSFT
  • 18,632
  • 10
  • 50
  • 73
1
vote
2 answers

TCL GUI tcl_precision

I'm using tclsh8.4.19 and the text values that get printed using tcl_precision 3 are upto 5 decimal places. i.e when i create a widget in tk gui the text values are uspto 5 decimal places and i want them to be upto 3 decimals only. label…
mayank
  • 21
  • 1
1
vote
1 answer

Is this "pixel shift" a bug in tcl/tk canvas?

Look at result of this script: canvas .c -bg white grid .c set x1 20 set x2 22 set y2 105 for {set f 0} {$f<50} {incr f} { set y1 [expr {$y2-0.05*$f}] .c create rectangle $x1 $y1 $x2 $y2 -fill black incr x1 2 incr x2 2 …
1
vote
2 answers

TCL: While no key is pressed loop

I would like to run a while loop until the stdin is filled with a character. puts "Press x + to stop." while {[gets stdin] != "x"} { puts "lalal" } The problem with the code above that it will wait for stdin and I don't want it to wait.…
patrick
  • 1,252
  • 4
  • 19
  • 36
1
vote
1 answer

Tk GUI Scrollbar

I've a problem that the scrollbar being made appears to be in the left, i've tried many combinations so as to move it to the right. My code looks like this: set dataSheetFrame($k) [frame $curPath($k).frame1 -height 420 -relief groove] #pack…
mayank
  • 21
  • 1
1
vote
2 answers

Linux Shell script, kill as another user

Recently I've been trying to get this script working: #!/usr/bin/expect -f set pssword [lrange $argv 0 0] spawn su - kod -c cd cod4 -c "nohup kill 7938" > /dev/null 2>&1 & expect "Password:" { send "$pssword\r" } expect "# " { send "q" } exit It…
1
vote
3 answers

TCL script generator for NS2

Is there an open source TCL script generator for NS2? There is NAM that comes with NS2. Is there anything else. A web based one would be great!
SparrowG
  • 221
  • 1
  • 4
  • 13
1
vote
2 answers

Tcl/Tk: using array with expr

I am running into problems while trying to access array inside an expr. The code which reproduces the error is shown below which is adapted from Donal Fellows answer to my earlier question. namespace eval Ns { } proc Ns::main_routine {} { global…
Anand
  • 1,084
  • 3
  • 20
  • 33
1
vote
2 answers

How to find out which version of Synplify you're using in a tcl script

I like to start a Tcl-Script in Synplify. Depending from the version of Synplify, it should do different things. But how can I find out which verion of Synplify it is, in the script? Is there any variable? Thanks, Kai
Kai___
  • 31
  • 2
1
vote
1 answer

Execution of simulation of scripts in ns2

i have installed ns2 and tcl on my desktop (fedora).When i try to run a simulation on nam1.14 it shows "could'nt execute ns :no such file or directory".When i try to run the tcl script it shows "bash:ns: command not found".Why is this happening? i…
Shashank
  • 11
  • 1
1 2 3
99
100