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
2 answers

How to make fread blocking and read until the end?

I am executing a TCL script from PHP using proc_open. I first open the TCL shell 2) Send a command using fwrite 3) What I need is fread to wait/block until the command sent by fwrite is complete and get all the contents .The command may take some…
Vidya
  • 7,717
  • 12
  • 48
  • 75
2
votes
3 answers

Tcl seek and write in a file opened with 'a+'

I need to store some logs in a file that can grow with every execution. A logical way would be to use a+ option when opening because using w+ would truncate the file. However, with the a+ option (Tcl 8.4) I cannot write anywhere in the file. seek…
ilya1725
  • 4,496
  • 7
  • 43
  • 68
2
votes
1 answer

How can I dynamically populate the values of TK combobox?

I am new to tcl/tk programming. Here is a small code snippet on combo box. How can I dynamically add and remove values from the combo box? set ff [ frame f] set label [Label $ff.label -text "Name:" ] set name [ComboBox $ff.name \ …
Prash
2
votes
2 answers

Checking if floating point number is whole number in tcl

I am new in tcl. I am trying to check if a given number is a whole number but can't seem to find a simple way to do this. So I have a number2 which is checking if it is on grid. If not a whole number then it is not on grid. set numberOne 7.5 set…
Rumman
  • 113
  • 1
  • 3
  • 8
2
votes
1 answer

TCL : regexp for Grammar of ANSI C++ Declarations

I am a beginner in TCL and trying to write a TCL script to parse and print out all lines in a C++ code file which is used for variable declarations. Till Now I am able to detect and print all statements inside a block {}. Now I understand that the…
Programmer
  • 8,303
  • 23
  • 78
  • 162
2
votes
3 answers

Need guidance in dealing with TCL regexp

I need to process a random string which has the character ".." in-between. Like the one shown below a..b/c..de/f-g..xyz..abc..def..123.. How can I get the data between these ".." using regexp?( this string can be of any length and I need to get each…
Nathan Pk
  • 709
  • 4
  • 18
  • 27
2
votes
5 answers

Exit status code for Expect script called from Bash

I made a Bash script which uses an expect script to automate ssh logins.The script connects to multiple servers and runs some commands. The bash script prompts for login credentials once. I want to incorporate a feature wherein the script terminates…
Sharjeel
  • 290
  • 1
  • 7
  • 17
2
votes
1 answer

Executing tcl script inside php

I am trying to execute tcl script inside php using passthru function. TCL script perfectly executes on the normal unix terminal. Whereas in php its not giving expected results on the browser. I am passing the environment variable using passthru…
2
votes
1 answer

How to package Tcl libraries in my own program?

In my c++ program, I used Tcl library and linked libtcl8.5.so, but the target hosts don't have tcl8.5, so I copied the libtcl8.5.so and tcl8.5 dir which contains init.tcl there, and set the environmet variable TCLLIBPATH to path/to/copied/tcl8.5,…
zhangailin
  • 926
  • 2
  • 10
  • 20
2
votes
1 answer

Tcl: how to conditionally replace within a multiline string

Given that I have a huge string, let's say 1000 lines, and let's name that string like "itext". And I am only interested in those lines in "itext" that contain the word "Description:". And make, for example, the following substitution ONLY on the…
user690182
  • 269
  • 1
  • 8
  • 20
2
votes
1 answer

reading .gif data from a scope into tcl and writing to a local file

Im reading a printscreen image from a scope that is in .gif format by sending a query to this scope. The returned data is in binary block form. I am communicating to this scope through a socket connection and using tcl. I could read the data fine,…
shokii
  • 21
  • 1
2
votes
1 answer

reading a buffer stream in tcl

This is a question regarding file reading in tcl. I am opening a buffer stream to write and i have only one file handler referece to it Now while reading this buffer line by line, at some condition I have to put all the content of the buffer, Please…
Ruchi
  • 693
  • 3
  • 14
  • 27
2
votes
3 answers

send spawn id exp4 not open error in expect

My ultimate goal is to do telnet to a router and interact with it. The following expect script does not help me at all. The router does not have any user id or pasword. it is automatic login. Expect file code. set iptotelnet "10.x.x.x" spawn telnet…
Alapati
  • 135
  • 1
  • 5
2
votes
3 answers

How to add Check box to treeview in Tcl/Tk?

I wanted to add Checkbox in the ttk::treeview ? i read few documents and found its not possible to add check box to add to ttk::treeview. Is there any other option to do this ?
Abarna R
  • 21
  • 1
  • 2
2
votes
2 answers

list doesn't contain its own members in Tcl

I have a list containing one member, that member is the string XXDDR0_MA[12]. When I search for that string in the list (using lsearch) I get that the list doesn't contain it. I even get it when I search for the member of the…
SIMEL
  • 8,745
  • 28
  • 84
  • 130
1 2 3
99
100