f



Sourcing a TCL file from within a tcl file

I am a newbie which I am sure I don't need to state :)

I am trying to create a variable with a TCL file that will source
another tcl file when I type the variable name

something like this

if I enter A through my keyboard  then source a.tcl

Can someone show me how to do this

thanks
guy


0
12/10/2008 8:15:14 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

14 Replies
973 Views

Similar Articles

[PageSpeed] 16

On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote:
> I am a newbie which I am sure I don't need to state :)
>
> I am trying to create a variable with a TCL file that will source
> another tcl file when I type the variable name
>
> something like this
>
> if I enter A through my keyboard =A0then source a.tcl
>
> Can someone show me how to do this
>
> thanks
> guy

What you are asking is not hard.  Will your program have a graphical
user interface?

Aric
0
aric.bills (466)
12/10/2008 8:26:16 PM
On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote:
> On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote:
>
> > I am a newbie which I am sure I don't need to state :)
>
> > I am trying to create a variable with a TCL file that will source
> > another tcl file when I type the variable name
>
> > something like this
>
> > if I enter A through my keyboard =A0then source a.tcl
>
> > Can someone show me how to do this
>
> > thanks
> > guy
>
> What you are asking is not hard. =A0Will your program have a graphical
> user interface?
>
> Aric

no I am just using this script to run a sinulation i'm doing.
0
12/10/2008 8:28:31 PM
On Dec 10, 1:28=A0pm, guy <gcoletta2...@gmail.com> wrote:
> On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote:
>
>
>
> > On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote:
>
> > > I am a newbie which I am sure I don't need to state :)
>
> > > I am trying to create a variable with a TCL file that will source
> > > another tcl file when I type the variable name
>
> > > something like this
>
> > > if I enter A through my keyboard =A0then source a.tcl
>
> > > Can someone show me how to do this
>
> > > thanks
> > > guy
>
> > What you are asking is not hard. =A0Will your program have a graphical
> > user interface?
>
> > Aric
>
> no I am just using this script to run a sinulation i'm doing.

Okay, you might do something like this (Tcl 8.5):

  set menudata {
    A {-label {Run script A} -script a.tcl}
    B {-label {Run script B} -script b.tcl}
    C {-label {Run script C} -script c.tcl}
    Q {-label {Quit}                      }
  }
  set choice ""
  while {$choice ni [dict keys $menudata]} {
    puts "----\nMenu"
    foreach key [lsort -dictionary [dict keys $menudata]] {
      puts "$key - [dict get $menudata $key -label]"
    }
    puts "\nMake a choice from the options above:"
    gets stdin choice
  }
  if {[dict exists $menudata $choice -script]} {
    source [dict get $menudata $choice -script]
  }
0
aric.bills (466)
12/10/2008 9:13:00 PM
In article <b153e584-4de6-4366-bdef-9df8724bd3c4@w1g2000prk.googlegroups.com>,
guy  <gcoletta2006@gmail.com> wrote:
>On Dec 10, 3:26�pm, Aric Bills <aric.bi...@gmail.com> wrote:
>> On Dec 10, 1:15�pm, guy <gcoletta2...@gmail.com> wrote:
>>
>> > I am a newbie which I am sure I don't need to state :)
>>
>> > I am trying to create a variable with a TCL file that will source
>> > another tcl file when I type the variable name
>>
>> > something like this
>>
>> > if I enter A through my keyboard �then source a.tcl
			.
			.
			.
Is
    source [string tolower $keyboard_entry].tcl
meaningful to you?  To me, that sounds like what you're after.
0
claird (2363)
12/10/2008 10:11:25 PM
On Dec 10, 4:13=A0pm, Aric Bills <aric.bi...@gmail.com> wrote:
> On Dec 10, 1:28=A0pm, guy <gcoletta2...@gmail.com> wrote:
>
>
>
> > On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote:
>
> > > On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote:
>
> > > > I am a newbie which I am sure I don't need to state :)
>
> > > > I am trying to create a variable with a TCL file that will source
> > > > another tcl file when I type the variable name
>
> > > > something like this
>
> > > > if I enter A through my keyboard =A0then source a.tcl
>
> > > > Can someone show me how to do this
>
> > > > thanks
> > > > guy
>
> > > What you are asking is not hard. =A0Will your program have a graphica=
l
> > > user interface?
>
> > > Aric
>
> > no I am just using this script to run a sinulation i'm doing.
>
> Okay, you might do something like this (Tcl 8.5):
>
> =A0 set menudata {
> =A0 =A0 A {-label {Run script A} -script a.tcl}
> =A0 =A0 B {-label {Run script B} -script b.tcl}
> =A0 =A0 C {-label {Run script C} -script c.tcl}
> =A0 =A0 Q {-label {Quit} =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
> =A0 }
> =A0 set choice ""
> =A0 while {$choice ni [dict keys $menudata]} {
> =A0 =A0 puts "----\nMenu"
> =A0 =A0 foreach key [lsort -dictionary [dict keys $menudata]] {
> =A0 =A0 =A0 puts "$key - [dict get $menudata $key -label]"
> =A0 =A0 }
> =A0 =A0 puts "\nMake a choice from the options above:"
> =A0 =A0 gets stdin choice
> =A0 }
> =A0 if {[dict exists $menudata $choice -script]} {
> =A0 =A0 source [dict get $menudata $choice -script]
> =A0 }

Thanks
Do I just put this is a tcl file an then source that file to get this
to work?
0
12/10/2008 11:17:26 PM
On Dec 10, 5:11=A0pm, cla...@lairds.us (Cameron Laird) wrote:
> In article <b153e584-4de6-4366-bdef-9df8724bd...@w1g2000prk.googlegroups.=
com>,guy =A0<gcoletta2...@gmail.com> wrote:
> >On Dec 10, 3:26=A0pm, Aric Bills <aric.bi...@gmail.com> wrote:
> >> On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote:
>
> >> > I am a newbie which I am sure I don't need to state :)
>
> >> > I am trying to create a variable with a TCL file that will source
> >> > another tcl file when I type the variable name
>
> >> > something like this
>
> >> > if I enter A through my keyboard =A0then source a.tcl
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
> Is
> =A0 =A0 source [string tolower $keyboard_entry].tcl
> meaningful to you? =A0To me, that sounds like what you're after.

thanks
can you explain what this does sorry :(
0
12/10/2008 11:28:12 PM
guy wrote:
> I am a newbie which I am sure I don't need to state :)
> 
> I am trying to create a variable with a TCL file that will source
> another tcl file when I type the variable name
> 
> something like this
> 
> if I enter A through my keyboard  then source a.tcl
> 
> Can someone show me how to do this

proc A {} { source a.tcl }

-- Neil
0
nem3909 (999)
12/10/2008 11:35:51 PM
On Dec 10, 6:35=A0pm, Neil Madden <n...@cs.nott.ac.uk> wrote:
> guy wrote:
> > I am a newbie which I am sure I don't need to state :)
>
> > I am trying to create a variable with a TCL file that will source
> > another tcl file when I type the variable name
>
> > something like this
>
> > if I enter A through my keyboard =A0then source a.tcl
>
> > Can someone show me how to do this
>
> proc A {} { source a.tcl }
>
> -- Neil

Thanks Neil !
0
12/10/2008 11:46:16 PM
Neil Madden wrote:
> proc A {} { source a.tcl }

Beware that

proc A {} {uplevel #0 source a.tcl}

is more likely what you want.

DGP
0
dgporter (104)
12/11/2008 4:14:29 AM
On Dec 10, 11:14=A0pm, Don Porter <dgpor...@verizon.net> wrote:
> Neil Madden wrote:
> > proc A {} { source a.tcl }
>
> Beware that
>
> proc A {} {uplevel #0 source a.tcl}
>
> is more likely what you want.
>
> DGP

why? what does uplevel #0 do?
0
12/11/2008 10:16:19 AM
guy coletta wrote:
> why? what does uplevel #0 do?

It does "run this at the global level". It's probably what you want to
do with the [source] command. :-)

Donal.
0
12/11/2008 10:35:29 AM
On Dec 11, 5:35=A0am, "Donal K. Fellows" <donal.k.fell...@man.ac.uk>
wrote:
> guy coletta wrote:
> > why? what does uplevel #0 do?
>
> It does "run this at the global level". It's probably what you want to
> do with the [source] command. :-)
>
> Donal.

Thanks Donal
0
12/11/2008 11:41:58 AM
In article <7a40e32b-5e66-4656-b6a1-93426b2412dc@v18g2000vbb.googlegroups.com>,
guy  <gcoletta2006@gmail.com> wrote:
			.
			.
			.
>> Is
>> � � source [string tolower $keyboard_entry].tcl
>> meaningful to you? �To me, that sounds like what you're after.
>
>thanks
>can you explain what this does sorry :(

I think you're better off going in the direction Neil and Donal
have sketched; they appear to understand your intent better than
I.

I suspect the best first step in me explaining more would be to
urge you to work through The Tutorial <URL:
http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html >.
0
claird (2363)
12/11/2008 4:39:04 PM
On Dec 11, 11:39=A0am, cla...@lairds.us (Cameron Laird) wrote:
> In article <7a40e32b-5e66-4656-b6a1-93426b241...@v18g2000vbb.googlegroups=
..com>,guy =A0<gcoletta2...@gmail.com> wrote:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .
>
> >> Is
> >> =A0 =A0 source [string tolower $keyboard_entry].tcl
> >> meaningful to you? =A0To me, that sounds like what you're after.
>
> >thanks
> >can you explain what this does sorry :(
>
> I think you're better off going in the direction Neil and Donal
> have sketched; they appear to understand your intent better than
> I.
>
> I suspect the best first step in me explaining more would be to
> urge you to work through The Tutorial <URL:http://www.tcl.tk/man/tcl8.5/t=
utorial/tcltutorial.html>.

Thanks Cameron,
And thanks for the link I have started going through another tutorial,
but I needed to understand this for an application I'm doing now you
know the pressures of having to work for a living :)
0
12/11/2008 6:27:45 PM
Reply:

Similar Artilces:

Tcl file from .txt file
Hi, I have a excel file. I need to change the excel file in to tcl file. I did = change the excel file in to txt file. but unable to change the txt file in = to tcl file. let me know any idea to change the txt file in to tcl file or = directly from the excel file in to tcl file.=20 your help is much more appreciated. thank you. On 11/14/14, 1:30 PM, yenilsuwal@gmail.com wrote: > Hi, > > I have a excel file. I need to change the excel file in to tcl file. I did change the excel file in to txt file. but unable to change the txt file in to tcl file. let me know any idea to c...

Dose there any tcl script to translate an file with embedded tcl
Hi I need to generate some big file, but there are rules for generate these files Ex . ============================== Start input a [0] wire input a [1] wire .. .. .. .. input a [1000] wire End ================================= Dose there any tcl script can help to translate a file with embedded tcl script into a new file For example this is a source file ======================== Start * set i 0 * for { set i 0 } { $i < 1000 } { incr i } { * puts input a [$i] wire * } End ========================== After Translate ======================= Start input a [0] wire input a [1] wire .. .. ...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

Is there a way to un-source Tcl source files?
Experts, When a Tcl source file gets sourced the script is getting passed to the Tcl-interpreter. As of my understanding the interpreter needs to have the code somewhere in memory and perform look-ups on procedure calls. My application has many Tcl source files. To save memory, and time for lookup of procedure code in the Tcl-interp I'd like to un-source source files when they are not needed to be present at a given time. Is there a way to tell Tcl to forget about the source code in a specific file? source foo.tcl unsource foo.tcl Thanks Bibi At Fri, 12 Jul 2013 09:44:22 -0700 (PDT) Bibi <bibi.postlmayr@gmail.com> wrote: > > Experts, > > When a Tcl source file gets sourced the script is getting passed to the Tcl-interpreter. > As of my understanding the interpreter needs to have the code somewhere in memory and perform look-ups on procedure calls. > > My application has many Tcl source files. > To save memory, and time for lookup of procedure code in the Tcl-interp > I'd like to un-source source files when they are not needed to be present at a given time. > > Is there a way to tell Tcl to forget about the source code in a specific file? > > source foo.tcl > unsource foo.tcl Not really, but you could use namespaces. If the file foo.tcl wraps all of its code in a namespace eval foo block, you can then later later delete the namespace with namespace delete foo. That is: fo...

tcl-inotify: File & directory level notifications for Tcl. (extension)
This is an announcement for a relatively new Tcl project: tcl-inotify. Tcl-inotify is a Tcl interface to the linux kernel's inotify* service. It provides a Tcl package that enables Tcl scripts to monitor the file system changes at a file and directory level. A large number of file/directory actions can be monitored. A proc is executed asynchronously to notify for changes. * inotify is a Linux kernel subsystem that provides file system event notifications. It was written by John McCutchan with help from Robert Love and later Amy Griffis to replace dnotify. It was included in the mainline kernel starting from release 2.6.13, and could be compiled into 2.6.12 and possibly earlier releases by use of a patch. Its function is essentially an extension to filesystems to notice changes to the filesystem, and report those changes to applications. Home page: http://sourceforge.net/projects/tcl-inotify/ Man page: http://tcl-inotify.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

TCL/PHP/XML problem: I need to convert an XML file into a TCL list
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: [TCL] set contents [read $fileID [file size ${fileName}.xml]]; close $fileID if {![string equal $switch -body]} { # ONLY DO THIS IF THE XML CONTENTS CONTAIN NO BODY - WILL UPGRADE AT A LATER DATE 11/24/2006 - PHIL global serverName if {![info exists serverName]} { global env source ./cgi_globals.tcl global serverName } if {[string length [info procs {URL_ENCODE}]] == 0} { source...

Komodo: Accessing widgets in the auto generated _ui.tcl from the associated .tcl file
I am using Komodo. I created a text widget and want to insert some text into it. The below is my ui.tcl file (ie. Dialog_ui.tcl). In my Dialog.tcl file I want to have access to the $base._text_log widget, so I can insert text into it. For eg. I've tried: ::Dialog::._text_log insert end "hello world!" And other variations, but have not succeeded. This seems to be something trivial, but I can't seem to figure it out. I also tried to get to the BASE variable, but was also unsuccessful. I guess my understanding of namespaces isn't correct. Is it even possible? Help is...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Does anyone have a Tcl Script which does a Multi Part File Upload to web site ( TCL CGI )
Hello all, I am after a Tcl script which I can use on my apache Linux server which a user can upload files or pictures to the site with ... Any help is appreciated, Thank you for the help, Sean - HeliHobby.com Sean wrote: > Hello all, > > I am after a Tcl script which I can use on my apache Linux server > which a user can upload files or pictures to the site with ... > > Any help is appreciated, > > Thank you for the help, > > Sean - HeliHobby.com I use ncgi for ths (from tcllib). It rocks! high quality code that never fails. For instance the file upload...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

How Tcl source finds init.tcl???
Hi, I have one question about how Tcl finds init.tcl. What environment variable does Tcl source use to get the search path for init.tcl? Is there any way to specifically use init.tcl from a certain path? Thanks a lot in advance! Lihong lihong pei wrote: > I have one question about how Tcl finds init.tcl. > What environment variable does Tcl source use to get the search path for > init.tcl? If the environment variable TCL_LIBRARY exists, it's value is assumed to be a single directory which is added to the search path for init.tcl. Note that this is offered mostly as a way for...

"no such file or directory" when executing tcl file
Hi, new to TCL and hitting a road bump right out the gate. I just installed ActiveTcl 8.5 on my Windows XP SP2 machine. I made the following script and saved it as test.tcl: #!/usr/local/bin/tclsh puts stdout {Hello, Patrick!} When in the TCL command prompt, I type test.tcl and it gives me the error "couldn't execute ".\test.tcl": no such file or directory". I am in the correct directory so I'm pretty lost as to why it is saying this. Here are my exact steps: <open command prompt> H:\workspaces\tcl>tclsh85 % dir Volume in drive H is Data Volume Serial Number is 828C-6076 Directory of H:\workspaces\tcl 01/12/2009 05:23 PM <DIR> . 01/12/2009 05:23 PM <DIR> .. 01/12/2009 05:37 PM 31 test.tcl 1 File(s) 31 bytes 2 Dir(s) 41,173,749,760 bytes free % test.tcl couldn't execute ".\test.tcl": no such file or directory If someone could help fill in the blanks here, I'd appreciate it. Apparently I'm overlooking something obvious. Thanks, Patrick On Jan 13, 12:43=A0am, "Patrick H." <patri...@gmail.com> wrote: > Hi, new to TCL and hitting a road bump right out the gate. I just > installed ActiveTcl 8.5 on my Windows XP SP2 machine. I made the > following script and saved it as test.tcl: > > #!/usr/local/bin/tclsh > puts stdout {Hello, Patrick!} > > When in the TCL command prompt, I type...

How to write tcl generated xml file into a new file
Hi, I have generated a xml file using xmlgen. After running the tcl script the ouput is displayed on the terminal . I want to take the terminal output into a xml file. Any Suggestion ???/ Thanks Ranjan On Nov 25, 12:46=A0pm, gyana behera <ranjan....@gmail.com> wrote: > Hi, > > I have generated a xml file using xmlgen. > After running the tcl script the ouput is displayed on the terminal . > I want to take the terminal output into a xml file. > > Any Suggestion ???/ > > Thanks > Ranjan Either redirect the output of the script to the xml-file. (xmlgen > output.xml) or open the file in the script: set f [open $filename w] then use puts $f instead of puts to output to the file and finally close the file: close $f Note that all this is covered in the Tcl tutorial, which is definitely worth a visit. (http://www.tcl.tk/man/tcl8.5/tutorial/ tcltutorial.html) Mark ...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

Protection against multiple tcl source file inclusions
Hello What is the most clever way to protect against multiple tcl source files inclusion ? For now, I'm adding this @ the start of my files : if { [namespace exists ::MyNamespace] } { return } Is there any better way ? Thx ! On 11/7/11 3:24 PM, Thomas MENEZ wrote: > Hello > What is the most clever way to protect against multiple > tcl source files inclusion ? > For now, I'm adding this @ the start of my files : > if { [namespace exists ::MyNamespace] } { > return > } > > Is there any better way ? Instead of sourcing them in, organize them into packages and do package require where you need them. -- +------------------------------------------------------------------------+ | Gerald W. Lester, President, KNG Consulting LLC | | Email: Gerald.Lester@kng-consulting.net | +------------------------------------------------------------------------+ ...

How to capture the output from TCL prompt and save it to a file on Linux file system.
Hello All, I login to TCL prompt and run a simple query which lists few rows. I want to capture those rows and save it to a file on file system. I am working on a Sun Solaris ver. 5.9. Here is the sample query that i run from TCL prompt: >SELECT DISTINCT CATEGORY FROM DS_JOBS; And the Resultant set looks like this: Category............ ABC\ACEIQ\JOBS\C UST_SPCLTY ABC\ACEIQ\JOBS\C UST_SPC SSHIP\SEQ PLIC\CNTRL Any advise is greatly appreciated. Thanks Vini On Mar 22, 7:26=A0pm, Vini <vinay.renukun...@gmail.com> wrote: > Hello All, > > I login to TCL prompt and run a simple query which lists few rows. I > want to capture those rows and save it to a file on file system. I am > working on a Sun Solaris ver. 5.9. > > Here is the sample query that i run from TCL prompt: > > >SELECT DISTINCT CATEGORY FROM DS_JOBS; > > And the Resultant set looks like this: > > Category............ > > ABC\ACEIQ\JOBS\C > UST_SPCLTY > ABC\ACEIQ\JOBS\C > UST_SPC > SSHIP\SEQ > PLIC\CNTRL > > Any advise is greatly appreciated. Wrong group. You mean "SQL" rather than "TCL". -Alex On Mar 22, 2:30=A0pm, Alexandre Ferrieux <alexandre.ferri...@gmail.com> wrote: > On Mar 22, 7:26=A0pm, Vini <vinay.renukun...@gmail.com> wrote: > > > > > > > > > > > Hello All, > > > I login to TCL prompt and run a simple query which lists few rows. I > > want...

Creating a TCL Channel from a C FILE* giving strange file handles
Hey Everybody! Having a problem with the Tcl C Library calls I cant seem to= figure out. I'm trying to create a channel from opened FILE *, and use it = in a TCL script that sources the module. So, what I am running so far is: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D int openCFileCmd(ClientData clientData,=20 Tcl_Interp *interp, int objc, Tcl_Obj *CONST o= bjv[])=20 ...

Can I compile a tcl/tk extended C file into an exe file on windows?
I'm new to tcl/tk. I have a simple tk/tcl extended C file like this, #include <stdio.h> #include <stdlib.h> #include <tcl.h> #include <tk.h> int Tcl_AppInit(Tcl_Interp* interp) { int status; status = Tcl_Init(interp); if (status != TCL_OK) { return TCL_ERROR; } /* Initialize Tk values. */ status = Tk_Init(interp); if (status != TCL_OK) { return TCL_ERROR; } return TCL_OK; } int main(int argc, char** argv) { Tk_Main(argc, argv, Tcl_AppInit); return 0; } Can I compile this file into an exe file on windows? How? Thank you ysrise@gmail.com (yan) writes: [snip[ ...

Save the file in strings, and evaulate the strings in Tcl source
Hi there, I am reading into the tcl source code, and hoping I can find a way to do this. I want to save a script file into char arrays inside the Tcl source code, and then I can "source" these char arrays as I "source" a script file. Is there a way I can do this ? Any comment will be greatly appreciated. Regards S-Y. Chen S-Y. Chen wrote: > I want to save a script file into char arrays inside the Tcl source > code, and then I can "source" these char arrays as I "source" a > script file. > > Is there a way I can do this ? Any comment will be greatly > appreciated. Use the Tcl_Eval() routine to evaluate a script stored in a properly encoded char array. DGP On Nov 14, 12:25=A0am, Donald G Porter <d...@nist.gov> wrote: > S-Y. Chen wrote: > > I want to save a script file into char arrays inside the Tcl source > > code, and then I can "source" these char arrays as I "source" =A0a > > script file. > > > Is there a way I can do this ? Any comment will be greatly > > appreciated. > > Use the Tcl_Eval() routine to evaluate a script stored in a properly > encoded char array. > > DGP I have used Tcl_Eval for command in one line, but.......dose Tcl_Eval also work for scripts expanding several lines ? Like : if while and such...... And, is there an example showing how can a script be "properly coded" in char array ? Thanks again ...

redirect output of "source a.tcl" to a file
I need to redirect output of TCL commands to a file. I have been able to do it by redirecting the command output using ">". Now I am stuck at source command as it gives me the error % source a.tcl > a.txt wrong # args: should be "source fileName" % How can I run source command and store its output in a file? -- San san <sandeep.gond@gmail.com> wrote: > I need to redirect output of TCL commands to a file. I have been able > to do it by redirecting the command output using ">". Now I am stuck > at source command as it gives me the error > % source a.tcl > a.txt > wrong # args: should be "source fileName" > % > How can I run source command and store its output in a file? Depends on how the "output" is generated inside the script: if it's just the returnvalue of the last command in it, then: set fd [open a.txt w]; puts $fd [source a.tcl]; close $fd if the a.tcl contains "puts" to stdout/stderr, you may replace the "puts" command to do something else. if the a.tcl contains calls to external programs that write directly to stdout/stderr, you'll have to reopen those channels first, but this effect will then remain even after the sourcing. source a.tcl does execute the commands in a.tcl within the same instance of tclsh as where you called "source" from. If you don't want any effects from a.tcl to remain in the curr...

tcl-snmptools: SNMP v1/v2/v3 operations for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-snmptools Tcl-snmptools is a Tcl interface to the Net-SNMP library which provides operations for the management of remote SNMP agents. It supports all the standard SNMP v1/v2/v3 operations: connect, close, get, set, getnext, walk, bulkget, bulkwalk, trap, translate and others. It is currently in a functional state, but more work and testing needs to be done. Home page: http://sourceforge.net/projects/tcl-snmptols/ Man page: http://tcl-snmptols.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

How Tcl speaks for itself and how Tcl is not spoken for...
Hello It's Friday and... well... Two things about Tcl going through my mind this week, a nice anecdote and a eyebrow-rising thing on Wikipedia: Anecdote: Until three months ago I worked in a scientific institue where I wrote much software in Tcl, especially a big Build and Report System, some tools for automatic checking of coding style and other things. Tcl had a bad reputation there (not because of me... they dropped Tcl before I started there in favour of Joy, then JavaScript and now Python) and besides me, there was only one co-worker who appearantly writes some small Tcl-Scripts to...

Web resources about - Sourcing a TCL file from within a tcl file - comp.lang.tcl

Sourcing
Sourcing Blog

How Facebook Became A Mobile-First Company, And Why It Is So Involved With Open Sourcing
Facebook Head of Mobile Release Engineering Christian Legnitto and Head of Open-Source Projects James Pearce spoke about the social network’s ...

Under the Hood: Building and open-sourcing RocksDB
Every time one of the 1.2 billion people who use Facebook visits the site, they see a completely unique, dynamically generated home page. There ...

Open-sourcing Haxl, a library for Haskell
Today we're open-sourcing Haxl, a Haskell library that simplifies access to remote data, such as databases or web-based services.

Facebook Seeks To Patent Crowd-Sourcing Translations Application
Facebook has had a lot of success since implementing localized sites early in 2008, through asking users to help translate the site into languages ...

Open Sourcing Clutch.IO - Twitter Blogs
... deploy instantly and run A/B tests. When Clutch co-founders Eric Florenzano (@ericflo) and Er... Skip to main content Sign in Search Open Sourcing ...

Thread: Crowd-sourcing the election.
... of, not just Republican dickheads. And yes, I know the title of this piece is funny. The founders of our country were the original crowd-sourcing ...

Procurement Professionals (#1 supply chain & sourcing group) Business, network, jobs & candidates
Executives Directors Banking Finance Corporate Alumni Managers Consultants Job Marketing Logistics Retail Career Consulting Recruiters Telecom ...

Flickr: CGP.PRO SOURCING's Photostream
We're professional sourcing company for variouse promotion products.

Massimo Banzi: How Arduino is open-sourcing imagination - YouTube
http://www.ted.com Massimo Banzi helped invent the Arduino, a tiny, easy-to-use open-source microcontroller that's inspired thousands of people ...

Resources last updated: 3/13/2016 12:07:52 PM