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

Tcl/Tk: entry button - getting values into entry without passing entry

I am implementing an entry and button with the following functionality. On clicking the button I will get a list of check buttons. After selecting check buttons they should get reflected in the entry. The following is my implementation. The one…
Anand
  • 1,084
  • 3
  • 20
  • 33
1
vote
2 answers

How do you delimit by "," instead of space in a TCL list?

So I've got a list, and in TCL the items are stored as {"1" "2" "3"}, space seperated. I'd like to convert this list to being {"1","2","3"} -- what would be an efficient way of doing this, aside from going through a foreach and lappending , to the…
user791953
  • 609
  • 2
  • 6
  • 20
1
vote
1 answer

Clearcase find command in combination with Tcl Script and Batch-File: Redirection doesn't work

it's me again ;-) I try to start the cleartool find command from a batch file. That batch files gets his arguments from a Tcl script. Batch File: SET VERARG="version(\main\LATEST) && !lbtype(%3)" cleartool find . -version %VERARG% -print >…
Kai___
  • 31
  • 2
1
vote
1 answer

How to figure out that one or more characters are in a string with regex in TCL

I need a simple solution to figure out whether some characters are in a string in Tcl. My idea is to do this with a regex. My string looks like: "word_word-word_word_word-word" or "word.word.word.word-word". My problem is, sometimes I get strings…
Chris
  • 446
  • 3
  • 9
  • 22
1
vote
1 answer

TCL, Regular Expression with ')', ']' or '}'

I'm trying, in TCL, to write a regex to detect 0 or more characters ')', ']' or '}' in the end of a string. Like the following, using a, b and c instead of ), ] and }... % regexp {[a]*$} "_______a" m 1 % put $m ; # Prints affected portion a %…
gmne
  • 11
  • 2
1
vote
2 answers

spawning Ruby IRB with Tcl Expect ends tragically in a broken pipe!

I am simply trying to open an irb window and enter commands. This used to work but somehow now it is broken: package require Expect set exp::winnt_debug 1 set errorInfo set SPAWN_ID "" set EXPECT_TIMEOUT 20 set PROMPT {irb.*[*">] } set RUBY_HOME…
Tom
  • 11
  • 2
1
vote
2 answers

How to implement a button whose functionality is a cross between radiobutton and checkbutton?

I want to dynamically disable or enable checkbuttons based on the options the user selects. What I would like is a cross between radiobutton and checkbutton. checkbutton .c1 -text "C1" -variable c1 checkbutton .c2 -text "C2" -variable c2 checkbutton…
Anand
  • 1,084
  • 3
  • 20
  • 33
1
vote
1 answer

Tcl - Reading characters from stdin without having to press enter in Tcl

I would like to read from stdin on a per character basis without the stdin being flushed. I could not find how to do that after tweaking for hours. Tcl always seems to wait for the channel to be flushed even in fconfigure stdin -blocking 0…
BenJay10
  • 25
  • 4
1
vote
2 answers

tcl: proc body in quotes instead of curly brackets

Is there any problem (e.g. a performance penalty) if the body of a proc is provided in quotes rather than curly brackets? My code generates procs (as OOP-like methods) inside of other procs, e.g. proc dataObject {name someData} { # more stuff …
Ralf
  • 757
  • 5
  • 16
1
vote
0 answers

Is it possible to call do files from a tcl script in modelsim?

I tried to write an automatic script for modelsim, where I would go through each possible malfunction in the circuit one by one, and then analyze it. For one malfunction, I did everything, and it works, however when I tried to make a loop where I…
artkuv
  • 11
  • 1
1
vote
2 answers

How do I set my first file in a directory to a variable in TCL?

I want to set the first file in my directory to a variable, how do I do it? Here is what I have tried so far: set files [glob "./programming/.business_files/*.txt"] set first_file $files[0]
Hannah J.
  • 13
  • 3
1
vote
1 answer

What does ::cetp::PAL mean?

I have a question about CETP(Common Expect Test Platform), it is a TCL testing platform. I saw the following code ::cetp::PAL what does this mean?
user707549
1
vote
2 answers

Pass global variable into function in tclsh

I defined 3 (global) constant for string first: set kColorGBegin "\x1b\[1;32m" set kColorRBegin "\x1b\[1;31m" set ColorEnd "\x1b\[0m" then I create 2 functions rendering and printing input string: proc r_puts {strs} { puts "${kColorRBegin}…
curlywei
  • 463
  • 4
  • 10
1
vote
1 answer

tcl dict: list values are arguments?

I'ver never used Tcl's dict before. While the interface looks easy enough to use, I'm totally surprised by its design and don't have a clue how this can work internally. Could someone please enlighten me? I'm probably missing something…
Ralf
  • 757
  • 5
  • 16
1
vote
2 answers

accelerate Tcl eval

I'm currently writing a Tcl-based tool for symbolic matrix manipulation, but the code is getting slow. I'm looking for ways to accelerate my Tcl code (Tcl version 8.6). I have one suspicion. My code builds lists with a command name as the first…
Ralf
  • 757
  • 5
  • 16
1 2 3
99
100