tcl

"exec source <script>" does not work in tcl

Hi all, I'm trying to call a script in Tcl with the command: exec source <script path> and I get the error couldn't execute "source": no such file or directory How can I call another script from tcl? Edit: I am running a command I got from another person in my office. I was instructed to run "source " explicitly with source. So i...

Why does my Tk application error out with "unknown color name white"?

I just installed tkdiff on a ubuntu machine and when I try and run the program I get the following error: actual font: -family {DejaVu Sans Mono} -size -12 -weight normal -slant roman -underline 0 -overstrike 0 Error in startup script: unknown color name "white" (processing "-foreground" option) invoked from within "text $w(Le...

do we need to "unset" variables in TCL ?

Is it a requirement of good TCL code? What would happen if we don't use the "unset" keyword in a script? Any ill-effects I should know about? I'm inheriting some legacy code and the errors that come about due to "unset"-ing non-existent variables are driving me up the wall! ...

How can I safely deal with optional parameters

I am writing a proc to create a header in an output file. Currently it needs to take an optional parameter, which is a possible comment for the header. I have ended up coding this as a single optional parameter proc dump_header { test description {comment = ""}} but would like to know how I can achieve the same using args proc dum...

timeout using TCL

Hi, Is there a way in TCL to enclose a piece of code in a timeout block? What I mean by that is that the block will exit after a particular timeout even if the execution is not complete. For instance:- timeout (interval) { #wait for socket connection here } If no connection is established in interval time, the block exits. Thanks ...

How to Programmically Delete Duplicate Records in a Tcl/Tk Treeview Widget

Hello: I have a treeview widget in my Tcl/Tk application that will often show duplicate records. I tried writting "lsort -unique" and "lrmdups" into my code to automatcally delete the treeview duplicates, but with no luck. If possible, does anyone know how to do this? Thank you, DFM ...

how to automate the testing of a text based menu

Hi there, I have a text based menu running on a remote Linux host. I am using expect to ssh into this host and would like to figure out how to interact with the menus. Interaction involves arrowing up, down and using the enter and back arrow keys. For example, Disconnect Data Collection > Utilities > Save Changes When you enter the s...

How to change the font and font size in ttk::button (themed widgets)?

How do you change the font and font size in the themed button widget (ttk::button)? ttk::button .x.buttonTEST -text "TEST" -font ?? # the -font option is not valid with ttk::button ...

howt to access COM port via script

Hello, I need to access COM port (console) via script to access our DSL modem. It should access in such a way that I can read all the messages printed on the console and i should also send commands to the console via script . Please let me know if it is possible in TCL or php . Platform : Windows XP. Also is there any way I can acces...

Tcl Podcast out there?

Is there any Tcl podcasts (in English)? It's not hard to find about Ruby, Python, Java, etc, but what about Tcl? ...

Example for accessing Tcl functions from Python

I see that elmer makes it possible to run Python code from Tcl. But is it possible the other way around? Could anyone give an example in Python? Update: by this I mean, being able to access Tcl objects, invoke Tcl functions, etc instead of simply running some Tcl code. ...

Adding objects to LDAP via CGI

I have a web form that collects information and submits it to a cgi that attempts to insert the data into LDAP. The problem is that I'm trying to use a variable with ::ldap::add and it's just not working. Here's the code: if {[string length env(QUERY_STRING)] != 0} { set handle [::ldap::connect localhost] set dn "cn=admin,dc=myc...

Unable to change the value of the variable

I'm using a discrete event simulator called ns-2 that was built using Tcl and C++. I was trying to write some code in TCL: set ns [new Simulator] set state 0 $ns at 0.0 "puts \"At 0.0 value of state is: $state\"" $ns at 1.0 "changeVal" $ns at 2.0 "puts \"At 2.0 values of state is: $state\"" proc changeVal {} { global state gl...

Convert XML to TCL Object

Greetings, I'm new to TCL scripting, and I have a very very basic xml file which I need to import information from into tcl. Example of XML Document Structure: <object> <type>Hardware</type> <name>System Name</name> <description>Basic Description of System.</description> <attributes> <vendor>Dell</vendor> <contract...

Plot graph from Database (Sqlite) data source wih zooming and navigation option, targeting all availbale web browsers

I want to plot a graph using Sqlite database data, and put this graph in a Html page, with different editing options (selection, Zooming. and navigation) ...

TCL array values updation based on command line argument

Hi, I am trying to substitute variable value inside array so as to update array values based on command line inputs. e.g. I am receiving IP address as command line argument for my TCL script and trying to update commands with recvd IP value. My array is: array set myArr { 1 myCmd1("192.268.2.1","abc.txt") 2 myCmd2("1...

Concatenating a Text in front of Individual Database Records with Tcl

Hello: In short, currently I am using the following code to pull records from multiple tables in a Sqlite Db and insert them in a single combobox ($SearchBar): set SrchVals1 [db eval {SELECT DISTINCT Stitle From Subcontract Order By Stitle ASC}] set SrchVals2 [db eval {... set SrchVals3 ... set SrchValsALL [concat $SrchVals1 $SrchVals...

VB6 ActiveX controls into a TCL/Tk application

Whats the most common way of instantiating VB6 ActiveX controls inside of an Tcl/Tk wrapper application. Are there performance issues with this setup i.e. around GDI handles? ...

TCL TDom: Looping through Objects

Using TDom, I would like to cycle through a list of objects in the following format: <object> <type>Hardware</type> <name>System Name</name> <description>Basic Description of System.</description> <attributes> <vendor>Dell</vendor> <contract>MM/DD/YY</contract> <supportExpiration...

TCL tDom Empty XML Tag

I'm using tDom to loop through some XML and pull out each element's text(). set xml { <systems> <object> <type>Hardware</type> <name>Server Name</name> <attributes> <vendor></vendor> </attributes> </object> <object> <type>Hardware</type> <name>Server Two Name</name> <attributes> <vendor></vendor> </attribute...