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

Chrome webpage inside a Tk frame

I want to run my chrome page inside a Tcl Tk frame. And I have to run my scripts from windows platform... As of now I am able to start the chrome page using the start command. How do I enclose my chrome page inside Tk window? eval exec [auto_execok…
2
votes
0 answers

.Error message wrong # args: should be "for start test next command" coming

I got the error message wrong # args: should be "for start test next command when trying to run the following code: proc finish {} { global ns nf $ns flush-trace #Close the trace file close $nf #Execute nam on the…
user3428116
  • 21
  • 1
  • 2
2
votes
1 answer

Tk's clipboard command sometimes not setting system clipboard

I've noticed that Tk's clipboard command sometimes does not really append to the system clipboard. I've noticed this in other programs previously (tkcon for example) where if I copy some text and try to paste it into another program (notepad for…
slebetman
  • 109,858
  • 19
  • 140
  • 171
2
votes
1 answer

How to check for and replace non UTF-8 characters in tcl?

What's the best way to search if a given string contains non UTF-8 characters in tcl? Is regexp'ing "^[\x00-\x7f]+$" the only way forward? I'm trying to write a tcl proc to check if a given variable contains non UTF-8 characters and if it does…
egorulz
  • 1,455
  • 2
  • 17
  • 28
2
votes
1 answer

Error when calling a python script from expect script

I have a python script called mypython.py which has a logger module imported. The mypython.py is called from an expect script called myexpect.exp. My issue is when I add a logger.info('test') statement in mypython.py and call it from myexpect.exp…
user3021774
  • 21
  • 1
  • 4
2
votes
1 answer

Execute linux command in tcl

When I execute the command openssl rand -base64 12 in the terminal it prints the output: mFpVuBreI0dPENLF I have the following tcl script where I have used exec to call to linux: for {set kb 0} {$kb<5} {incr kb} { exec openssl rand -base64 12…
user3304467
  • 81
  • 1
  • 9
2
votes
1 answer

How to find the script location where the called proc resides?

The script have sourced N number of files.., source file 1 source file 2 . . source file N when particular procedure A called ., Its actually present in most of the sourced files., anyway the last sourced file containing that proc A will do the…
Downey_HUff
  • 191
  • 9
2
votes
1 answer

Parse xml files to variable

In TCL Script Nymex Feed Test1 Nymex Feed Test2
Hmnshu
  • 230
  • 1
  • 5
  • 13
2
votes
1 answer

I need to run tcl script with options from another tcl script

I have a tcl script drakon_gen.tcl . I am running it, from another script run.tcl like this: source "d:\\del 3\\drakon_editor1.22\\drakon_gen.tcl" When I run run.tcl I have following output: This utility generates code from a .drn file. Usage:…
vasili111
  • 6,032
  • 10
  • 50
  • 80
2
votes
4 answers

How to dynamically modify a proc body during runtime?

I want to do something like this in principle: #grab some value from outer source (i.e. file or list defined by another programer) set original_proc_name foo #define function with a specific name using the string from that outer source proc…
AturSams
  • 7,568
  • 18
  • 64
  • 98
2
votes
1 answer

Sort a dict by its value pairs

I have a dict which looks like this: Unsorted: 12 {12 489} 29 {89 12} 27 {301 302} 26 {489 329} 8 {89 302} 55 {44 301} I would like to sort it like this: 55 {44 301} 27 {301 302} 8 {89 302} 29 {89 12} 12 {12 489} 26 {489 329} As you can see,…
Lumpi
  • 2,697
  • 5
  • 38
  • 47
2
votes
1 answer

TCL AES <-> C# AES - Tcl encrypted text is ASCII

I am new to TCL and need some help here. I wrote a client/server application: The server is implemented in C# (.Net 4.51) the client in TCL 8.2. The basic communication is working fine, now I need to encrypt the messages passed between client and…
Soernt
  • 338
  • 2
  • 10
2
votes
2 answers

How to read special characters like "ó" in Excel with TCL?

There are some special characters in my .xls file. I am trying to read all lines in .xls and write them into .txt file, but characters are changed. For example: There are ós in the Excel. TCL Script: set Channel_Read [open Sample.xls r] set…
2
votes
1 answer

Is lookbehind and lookaround concept avail in TCL regex engine?

Is lookbehind and lookaround concept avail in TCL regex engine? I came across this page, i didn't see any concept and example about lookbehind and lookaround, even when i execute sample program with lookbehind and lookaround concept where i am not…
velpandian
  • 431
  • 4
  • 11
  • 23
2
votes
1 answer

How to print elements from tcl_obj in gdb?

I am debugging a c++-tcl interface application and I need to see the elements of Tcl_Obj objv. I tried doing print *(objv[1]) and so on but it doesnt seem helping. Is there any way to see Tcl_Obj elements in gdb?
Ruchi
  • 693
  • 3
  • 14
  • 27