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.

Filter by
Sorted by
Tagged with
2 votes
0 answers
24 views

How to use tommath in a Tcl extension

I'm building a Tcl extension in c that needs to create new bignum Tcl_Objs (using Tcl_NewBignumObj), which takes an mp_int (libtommath's type). My extension (by default) calls Tcl's API through its ...
Cyan Ogilvie's user avatar
-1 votes
1 answer
55 views

Variable in HTML drop down menu [closed]

i need to create an HTML drop down menu with option variable based on external list. i'm tryng with: set item_list [$var] <select> <option value="$item_list">$item_list</...
Kimetik's user avatar
1 vote
2 answers
44 views

tcl how to redefine "set" command

I am new comming of tcl. How to use tcl to imitate "set" command? I try to build like below cold, but below code with error: unknown command name: proc my_set {varName {value ""}} {...
JoshTitle's user avatar
0 votes
0 answers
34 views

py2exe creating tk and tcl folder how to exclude it

I Am trying to convert my python project into a exe using py2exe, Iam successful in doing it, however py2exe is creating tk and tcl folders in dict/lib. My project does not import tkinter nor any ...
Sathiya dhev S's user avatar
0 votes
1 answer
54 views

Tcl how to remove only specified list item?

i need a solution to remove from a list only a specified file without removing other file. Now i'm using follow: [lreplace $var end end] where $var is a directory contain a list of file Example: ...
Kimetik's user avatar
0 votes
1 answer
36 views

Tcl: get Tcl objects generated by C/C++

Third party software, lets name it 3RD has embedded TCL. Some function in 3RD execute TCL or create TCL objects. During execution generate several commands (events?) in specific order, e.g.: cmdInit ...
user_mpr's user avatar
-1 votes
2 answers
54 views

Need Sorted Tcl Output

I have a file called file1.txt whose contents are as described below Contents for file1.txt: AND 60 NAND 20 OR 30 SUN 90 SIN 10 SIM 80 EW 25 NEW 85 PHEW 55 So, total the file has 9 lines with two ...
user2643899's user avatar
0 votes
1 answer
44 views

Tcl: information about currently executed interpreter

I am using TCL embedeed in third party software. I am trying to get info what is the name\path of main interpreter used by third party software and also information if there exist some slave ...
user_mpr's user avatar
2 votes
2 answers
88 views

Efficient method of splitting strings into segments of equal length?

Is there a fast way to split a string into segments of equal length in SQLite and/or Tcl? My goal is to take a string in memory and write the splits to rows in a table. Sometimes the string is passed ...
Gary's user avatar
  • 2,559
0 votes
1 answer
38 views

Confused about getting utf-8 text with special characters after decoding XOR frames?

I seem to be especially dense-headed when it comes to this topic. I have utf-8 text (JSON strings from the browser) that have em dashes and curly apostrophes in them; and I'd like to store that in a ...
Gary's user avatar
  • 2,559
0 votes
1 answer
31 views

Performing XOR to unmask web-socket data frames cu* versus I*u*?

I came across this "32-bit integer" method of reading and applying the XOR mask in a web socket and tried it out in my very simple local server for a desktop application and wondered if it ...
Gary's user avatar
  • 2,559
0 votes
1 answer
57 views

Start a tcl and copy the current environment

When executing a tcl script, it is often necessary to print some results to make sure the process is correct, which means need writing some puts in the script. Is there a way to start another tclsh ...
piper's user avatar
  • 79
1 vote
1 answer
58 views

Tcl variable interact in different namespace, how to fix

In tcl, I need to source some files, file1, file2, file3,.... fileN, I create each namespace for each file, but the var set in each namespace will impact other namespace's var below is my code: proc ...
JoshTitle's user avatar
1 vote
2 answers
74 views

Ensuring that variable substituion in SQLite from Tcl will always be of the desired type?

What is the proper way to ensure that Tcl variables are treated as the correct type in SQLite? This active session appears to be about the simplest scenario possible in setting number to 50 but it ...
Gary's user avatar
  • 2,559
0 votes
0 answers
32 views

Pass variable from .tcl to .cc in ns2

I want to pass nodenumber from .tcl to .cc file I use this code but I got this error error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] The code: in .tcl file: Agent/AODV set ...
science computer's user avatar
1 vote
0 answers
64 views

How to run `zig cc` from build.zig?

Motivation: I want to use Tcl and zig in the same project. zig is a versatile compiler and Tcl has very compact and easy to comprehend syntax. First step is to compile Tcl C sources with zig. ...
MKaama's user avatar
  • 1,761
0 votes
2 answers
44 views

How to deiconify and raise Tk window when using GNOME as desktop environment

The program below creates a window that contains a button. When the button is clicked, the window is iconified (minimized). After 3000 milliseconds, the window is supposed to deiconify and raise ...
Flux's user avatar
  • 10.1k
1 vote
1 answer
50 views

Removing the second word in a string in Tcl

Lets say I have a string wordone wordtwo wordthree. I don't know what wordtwo will be but it needs to be removed whenever it exists. What can I do to remove it. I attempted to use lreplace $string 1 1 ...
notatclgenius's user avatar
1 vote
1 answer
49 views

TclOO : Export/Import Class

Is there any way to export my class, like we can do for a command with namespace export/import ? My intention is to be able to use the name of my class without its namespace. namespace eval ns {} oo::...
Mkn's user avatar
  • 554
0 votes
0 answers
27 views

MinGW outputs a `*.0` file when I thought it would output a `*.dll` (Dynamic Link Library) & is only (roughly) half the size it should be

I am trying to compile a TCL/TK package in MinGW on Windows 64-bit, which should (I think) output a Dynamic Link Library, but instead it outputs *.0 file (which I have never heard of before), which is ...
Zamyatin's user avatar
0 votes
0 answers
42 views

MinGW doesn't have the libtclstub.a and libtkstub.a libraries so TCL won't compile

Using: Windows 10 64-bit with MINGW64 on Git Bash. I've been trying to compile a TCL package in MinGW (https://sourceforge.net/projects/mingw/) (which the package said to use), but C:\MinGW\lib doesn'...
Zamyatin's user avatar
0 votes
0 answers
46 views

Filter out pins having same clock attribute

Getting all fanin to the endpoint get_pins [all_fanin -to <end_point>/d -flat -startpoints_only] Above will give list of clocks pins coming to the endpoint. Now If I want to filter out clock ...
Raviraj's user avatar
  • 35
1 vote
0 answers
40 views

NS2 TCL Script Simulating Wireless LAN

I am attempting to simulate a wireless LAN environment in NS2. I am currently running Ubuntu 15.10 on a virtual machine working with NS2 version 2.35. I am required to used this specific OS. My script ...
Nathan H's user avatar
1 vote
2 answers
59 views

How to print "\n" stored in variable in TCL

I have a variable that is set by the user, lets say a is "/n/nhelloworld" I don't want "\n" to create a new line but instead for it to be printed. Basically for an output of the ...
notatclgenius's user avatar
0 votes
0 answers
19 views

Restart simulation without showing windows "keep"

I write a TCL file to automatically change signals and restart the simulation for a few times. But I meet one problem: each time the command "restart" executes, a window "keep" ...
KabiLink's user avatar
1 vote
2 answers
37 views

Can a non-interactive tclsh be made interactive?

When developing Tcl code, I find the interactive facilities of tclsh very useful, and I'll often launch tclsh interactively, source code from files, and continue to run and debug from there. What I'm ...
screwtop's user avatar
  • 111
0 votes
2 answers
66 views

how to append two list of one element and keep them still a list?

For example: % set l [list a] a % set l [list $l b] a b % set l [list $l c] {a b} c Question: The question because im coding when i get tclsh parse result.because i used regular expression to parser ...
FlyDoggie's user avatar
0 votes
0 answers
53 views

Tcl 8.6.9 script picking up incorrect File name

I have been seeing this error when running Tcl scripts on Tcl version 8.6.9. The Executive Software has been picking up the .tcl file name as "--.conf.tcl" instead of "System.conf.tcl&...
programmercoder's user avatar
0 votes
2 answers
62 views

"Compact" query strings for prepared-statement cache?

If SQL queries are stored in Tcl variables declared across multiple lines to keep them readable, using: set ::SQL::QueryName { } and executed using db eval $::SQL::QueryName should something be done ...
Gary's user avatar
  • 2,559
0 votes
1 answer
39 views

Get time difference without converting to epoch using tcl

I am using tcl to get time difference, however I am first converting the time to epoch then doing the difference. Looking for how to do this without converting to epoch. set t1 "00:00:11.026&...
newdeveloper's user avatar
0 votes
1 answer
62 views

TCL TK, how to add a scroll bar

I have this procedure that create a windows that display a list of scenario to be executed. a list is displayed with for buttons (check all, uncheckall, ok, annuler) and we are able to check items in ...
iostrym's user avatar
  • 79
0 votes
0 answers
56 views

Error on Tcl version 8.6.9 Package Profiler Error (package ifneeded profiler)

I have been seeing this error when running Tcl scripts on Tcl version 8.6.9: attempt to provide package profiler 0.4 failed: package profiler 0.5 provided instead ("package ifneeded profiler 0.4&...
programmercoder's user avatar
0 votes
1 answer
59 views

Can anyone tell me why Tcl fails to simply read a specific file? Also the contents of the file fails when doing a string length

The following 2 lines never return and no error is thrown using wish.exe. I have tried in tcl 8.4 and 8.6. File is successfully read with node. set fp [open "test.lst" r]; set file_data [...
Wadsack's user avatar
  • 25
0 votes
0 answers
46 views

Tcl script in the synopsys dc_shell stopped. How can I continue?

during the execution of my .tcl-script in the dc_shell of synopsys, I accidentally hit the ESC button and now it stopped executing. I just have a blank line at the bottom of the shelf with the ...
Python_Coder's user avatar
-1 votes
1 answer
76 views

Tcl regsub issue

I'm trying to write a TCL script to regsub a string within the contents of a file. The string I'm searching for is a hexadecimal value denoted as X"12312312" I want to replace this string ...
GLW75's user avatar
  • 37
0 votes
2 answers
68 views

Clock clicks and unixepoch('now','subsec')

I'm trying to log the time that it takes for certain procedures to process; but not really what might be considered performance testing in terms of comparing different code methods to generate the ...
Gary's user avatar
  • 2,559
0 votes
1 answer
88 views

Check if a variable is redefined by Tcl

In my script, I will source other owner's TCL script. I try to check all variable if redefined in their tcl script file, Here I try in my script: proc trace_var {args} { set frame [info frame]; ...
JoshTitle's user avatar
3 votes
1 answer
112 views

Tcl_GetDoubleFromObj is a disadvantage on the iteration of a list

My goal is to iterate a list to find out what my values correspond and add the type in another list. To do this, I proceed as follows in Tcl. proc TCL_dataType {dataList} { set Tag {} foreach ...
Mkn's user avatar
  • 554
2 votes
2 answers
88 views

How to push a channel transformation for reads without using TclOO?

My question concerns pushing a channel transformation during a read. I coded this web socket (sort of a web socket) for the purposes of using a browser as the user interface and Tcl as the local ...
Gary's user avatar
  • 2,559
0 votes
2 answers
48 views

What is the different between set something and set_something in tcl code

Hi guys I want to ask a supper newbie question here as I want to do my work without the need of learning tcl from scratch. I know that set is a command that assign value to the variable. However, I ...
user13626458's user avatar
2 votes
2 answers
51 views

In Tcl, is there a performance problem to store dictionaries inside a list (to return it from a procedure with other values)?

I need to have a procedure that return a dictionary and a status value (ok/fail). currently the procedure return only the status and I use a global dictionary to be able to read/write inside it. I ...
iostrym's user avatar
  • 79
0 votes
2 answers
31 views

How to write a procedure in TCL that will use either a global dictionary or another one

I have a procedure that use a global dictionary. it is a global one because I need the procedure to be able to read inside the dictionary and update it. I need to be able to use either this global ...
iostrym's user avatar
  • 79
1 vote
1 answer
59 views

Using incrblob to determine byte location in a BLOB segment based on a character location in text string?

My question concerns this scenario. I'm storing text as a BLOB using incremental blob I/O of SQLite in the Tcl interface. Another table in the database contains rows of pointer data that point to ...
Gary's user avatar
  • 2,559
1 vote
1 answer
61 views

Propagating errors and rolling back transactions that span procedure calls?

My question concerns catching errors and rolling back database transactions when the transaction spans a few levels of procedures calls. I wrote the code, first, just to get it working and used a lot ...
Gary's user avatar
  • 2,559
0 votes
1 answer
43 views

Caching prepared statements in the SQLite Tcl Interface

This question concerns coding properly in Tcl to best take advantage of SQLite's resetting of prepared statements rather than finalizing them. Is there any difference, in regards to caching prepared ...
Gary's user avatar
  • 2,559
0 votes
1 answer
54 views

Passing variables to procedures versus using upvar?

Is there a cost to using upvar such that it ought to be used only when the objective is to have a procedure set a variable's value in a context "above" it; and not use it in lieu of passing ...
Gary's user avatar
  • 2,559
0 votes
2 answers
50 views

tcl how to get command executed in which file and which line?

how to know when I source the tcl script, which proc/eval is executed in which file & which line? below is my code: set counts [info frame]; set frame_list [info frame [expr {$counts - 2}] ] ...
JoshTitle's user avatar
0 votes
2 answers
85 views

Is there a recommended best practice for structuring dictionaries to avoid shadowing keys at the same level of nesting?

I'm trying to understand how much "work" takes place in the background when writing a few lines of code in Tcl for dictionaries, specifcially dict with...{}. I'm sure this is a very novice ...
Gary's user avatar
  • 2,559
1 vote
2 answers
68 views

tcl: how to rebuid foreach_in_collection as proc in tcl

for some reason, I need to rebuild foreach_in_collection (SDC command) as "foreach" in tcl. here's snapshot code: proc set_disable_timing { argv } { body ... } proc get_cells { argv } { body ...
JoshTitle's user avatar
0 votes
1 answer
42 views

Tcl: pass argument with square brackets to procedure (SDC)

I want to build a SDC simulator. here's my proc: proc set_false_path { body ... } proc get_pins { body ...} And I use tcl build-in "source" to read the SDC file, MY_SDC_FILE.sdc (there are ...
JoshTitle's user avatar

1
2 3 4 5
159