tcl

Opening Blob Data stored in Sqlite as a File with Tcl/Tk

I am using the following tcl code to store a file from my deskstop into a Sqlite database as blob data ($fileText is a path to a text file): sqlite3 db Docs.db set fileID [open $fileText RDONLY] fconfigure $fileID -translation binary set content [read $fileID] close $fileID db eval {insert into Document (Doc) VALUES ($content)} db close...

Tcl question - how to list functions in a namespace

I am trying to list all of the functions a namespace has in it (warning - I'm really new to Tcl, so I'll probably use the wrong words for parts of Tcl). For example, I have a tcl shell someone compiled for me (if that's the right way to phrase it), and I know at least one function exists, let's call it blah::do_something I know in ru...

Tcl 7.x with TLS/SSL

I know there is a TLS package for Tcl 8.x. I cannot find any packages to do TLS/SSL on Tcl 7.x. I would be happy to get any pointers to such an implementation. ...

parsing html pages from tcl

Hello , I using tdom version 0.8.2 to parse html pages. From the help pages I found the following commands to get the ElementById TCL code set html {<html> <head> </head> <body> <div id="m"> </div> </body> </html> } package require tdom set doc [ dom parse -html $html ] set node [ $doc getElementById m] But when I execute the s...

Maintain Http session for get and get operation in Curl TCL.

i have created http seesion, using the same http session, i would like to do some get and set operations. Note : What ever the operation, data is present in XML Format, giving xml file as input. And need to fetch the status. Is it possible using TCL curl. ...

Is there a way to pass params to a script in TCL that is run using eval source?

I have a script that calls: eval source \{$scriptfile\} where $scriptfile is another TCL script. Is there way to pass parameters to the script? I'd like to do something like: set sampleData "ID=14678934" eval source \{$scriptfile\} $sampleData I know that this isn't allowed but, is there a way to pass data to a script that is ...

how to use procedures in package with different versions in tcl

My question is i have created two versions that is 1.1 1.2 packages i have same procedures in 1.1 and 1.2 but i modified a new version of procedure in 1.2. Now my question is suppose to want acess old version (1.1) procedure. How i do? ...

How to get ouput from expect

i wrote a script for spawing the bc command package require Expect proc bc {eq} { spawn e:/GnuWin32/bc/bin/bc send "$eq\r" expect -re "(.*)\r" return "$expect_out(0,string)" } set foo "9487294387234/sqrt(394872394879847293847)" puts "the valule [bc $foo]" how to get the output from this. When i am running this one i...

Is there any real documentation or code examples on how to use the expect4j library?

The documentation on the google code project page is pretty thin. I'm wondering if there is any in depth documentation on using expect4j; code examples would be helpful as well. ...

including tk.h and tcl.h in c program

hi, i am working on an ubuntu system. My aim is to basically make an IDE in C language using GUI tools from TCL/TK. I installed tcl 8.4, tk8.4, tcl8.4-dev, tk8.4-dev and have the tk.h and tcl.h headers file in my system. But, when I am running a basic hello world program it's showing a hell lot of errors. #include "tk.h" #include "stdio...

including tk.h and tcl.h in c program

hi, i am working on an ubuntu system. My aim is to basically make an IDE in C language using GUI tools from TCL/TK. I installed tcl 8.4, tk8.4, tcl8.4-dev, tk8.4-dev and have the tk.h and tcl.h headers file in my system. But, when I am running a basic hello world program it's showing a hell lot of errors. #include "tk.h" #include "stdio...

How to authenticate passkey from a Tcl script calling bash?

I have a tcl script that calls a lot of functions from bash including ssh. The part I'm struggling with looks like this: proc connect {where} { set bash c:/cygwin/bin/bash catch {exec $bash -c "ssh $where"} result puts $result } connect user@localhost I get the authentication failed message: Pseudo-terminal will not be al...

Different search paths for tclsh

Any one knows how can I invoke the tclsh in the Tcl code due to different paths to tclsh in various platforms (Linux, SUN)? For example in SUN: #!/usr/bin/sun/tclsh in Linux: #!/usr/bin/linux/tclsh How can I use the same Tcl code and execute it in the above two paths? ...

How to remove unwanted charecters using split in tcl

Here is an example Interface {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} IP-Address {} {} {} {} {} OK? Method Status {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {Protocol FastEthernet0/0} {} {} {} {} {} {} {} {} {} {} {} unassigned {} {} {} {} {} YES unset {} administratively down down {} {} {} { FastEthernet0/1} {} {} {} {} {} ...

Can't call tcl commands in procedures that I can in console

I installed cygwin/curl on my machine and from tcl console or tclsh I can call the curl command however if I try to do it in a procedure I get the "invalid command name (name)" error. e.g. %curl -o google.html http://www.google.com works, but %proc a {} {curl -o google.html http://www.google.com} %a gives invalid command name "cu...

how to convert a list into string in tcl

How do I convert a list into string in Tcl? ...

How to get Command history by cursor key in Linux tclsh : TCL

I am new to TCL and I wanted to know, if I can get the command history by using cursor key (like up arrow key) in TCL shell (tclsh). I am running tclsh on fedora with linux version 2.6.21. ...

How to find error in TCL code

Hi all, I am learning TCL and wanted to know how can I find out errors in my code. I mean what line no is error happening or how can I debug it. Following is the code which I am trying : proc ldelete {list value}{ set ix [lsearch -exact $list $value] if{$ix >=0}{ return [lreplace $list $ix $ix] } else { ret...

Auto completion by typing TAB in TCL

hi all, How can I achieve auto-completion of key words and directories by typing TAB (or something else) in TCL shell , tclsh. Thanks in advance aditya ...

SWIG support for inheritance of static member functions

SWIG doesn't wrap inherited static functions of derived classes. How it can be resolved? Here is a simple illustration of the problem. This is a simple C++ header file: // file test.hpp #include <iostream> class B { public: static void stat() { std::cerr << "=== calling static function B::stat" << std::endl; } void nonstat() c...