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.13 (Nov 22, 2022).

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

Questions:

Books:

Websites:

7879 questions
2
votes
1 answer

How to Create Installation Script for Tcl Package

I have a Tcl package which consists of a couple modules, unit tests, and samples; which I am looking to distribute. I have searched, but not found any easy/simple way to create installation script for it. I looked at other packages such as Tclx and…
Hai Vu
  • 37,849
  • 11
  • 66
  • 93
2
votes
2 answers

Display the tail of a filename in an entry box

I regularly find myself writing Tk dialog boxes using ttk::entry widgets to prompt for a filename. I save the user's last input to such a dialog and display it as the default when next displaying it. After I've populated the widget, if the full…
nurdglaw
  • 2,107
  • 19
  • 37
2
votes
1 answer

Tcl C++ API - how to type safe convert a void pointer

I am using Tcl_CreateObjCommand(interp, cmdName, proc, clientData, deleteProc) in my code and passing in a DerivedClass pointer to the clientData parameter. In the callback function, I want to type safe convert (dynamic_cast) the clientData back to…
Stan
  • 37,207
  • 50
  • 124
  • 185
2
votes
1 answer

Not able to capture the ouput of lscript into the file using PHP

I wanted to capture the output of the TCL script into the file using PHP. I am able to capture hello world output to the file but when I am running long script which takes time and have large output then I am not. Here is my code:
pgupta
  • 21
  • 3
2
votes
1 answer

Am I missing the target with exp_continue?

I'm trying to write an expect script that allows me to ssh into a switch, look for a certain set of software in flash, then delete it. I would like to say that if you see result "A" do action "B", and if you see result "C" do action "B". All of…
bjforesthowell
  • 67
  • 1
  • 10
2
votes
1 answer

Bind event to individual characters tcl/tk

I'm trying to display binary information in a widget (ie. text, entry, label). The individual characters, in this case only '0' or '1' should be clickable so that they toggle between 0 and 1. I'm not quite sure which widget to use and how to bind a…
sebs
  • 4,566
  • 3
  • 19
  • 28
2
votes
2 answers

how to extract array indices using regular expressions in tcl

I have a range string either in the form of [Numeric1] or [Numeric1:Numeric2] Brackets are part of string as well. I want to have one regular expression that will give me Start index and another regular expression to give me End Index regardless of…
l-gr-21
  • 31
  • 2
2
votes
1 answer

how to copy directory if target directory already exists

I wanted to copy directory to the specific target but got error because target directory was already existed. So I added -force flag but got the same error. Example: file copy -force my_dir $target_path error copying "my_dir" to "my_dir": file…
Roman Kaganovich
  • 618
  • 2
  • 6
  • 27
2
votes
2 answers

TCL variable name substitution

I have several lists: AllMaxMins_LC1 AllMaxMins_LC2 AllMaxMins_LC3 and so on Now I want to go through each list like this: for {set i 1} {$i < 10} {incr i} { foreach SubList $AllMaxMins_LC$i { # do something } } I know that the way…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
2
votes
1 answer

what is the following regular expression trying to match?

I saw a re like this: regexp "hello\[^\\n]*06" $str what is the \[^\\n]* trying to match?
user2131316
  • 3,111
  • 12
  • 39
  • 53
2
votes
1 answer

tcl error "can't find package struct::tree "

I tried to use the tree package for TCL but I'm unable to find any documentation at all. When trying to run the examples from http://tcllib.sourceforge.net/doc/struct_tree.html, i get the error can't find package struct::tree Can anyone tell me…
Monty Swanson
  • 695
  • 16
  • 41
2
votes
1 answer

Creating trees in tcl

I want to create an AVL tree in tcl. I read that in tcl we cannot have structures that contain references of themselves like in C. struct tree{ tree *treelink; } I want to be able to create the trees without using OTcl. Is it possible and how?
Monty Swanson
  • 695
  • 16
  • 41
2
votes
0 answers

How to pass nested soap request parameters using TCLWS package?

This is the sample request I would like to make, to get the matching results from TABLE1 & TABLE2
ctx
  • 79
  • 1
  • 2
2
votes
1 answer

invalid argument when using TCOM from TCL script. ActiveTcl

I use ActiveStates TCL version 8.6.0.0 for Windows x64. In a script I call: package require tcom Tcom is included in the installation but I get the following error: couldn't load libary "C:/TCL/lib/tcom/tcom.dll": Invalid argument while…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
2
votes
1 answer

TCL code dependency generator

I have a large code base written on expect/TCL version 5.39. I need to get a good understanding of the flow, is there a good dependency graph generator for TCL or a great TCL IDE which takes me to the procedure/variable definition/declaration when I…