# Simple Tcl/Tk scripts:



## regexorcist (Feb 16, 2010)

This thread is for simple tcl ot tcl/tk scripts or code snippets.


----------



## regexorcist (Feb 16, 2010)

*Simple perl scripts:*

How can I compile Tcl type scripts into binary code

http://wiki.tcl.tk/855


----------



## Clement (Feb 17, 2010)

*Begining Tcl*

_Here are a few resources on Tcl I have found to be very useful._

*Wikipedia:*


> http://en.wikipedia.org/wiki/Tcl
> Tcl (originally from "Tool Command Language", but conventionally rendered as "Tcl" rather than "TCL"; pronounced as "tickle" or "tee-cee-ell"[2]) is a scripting language created by John Ousterhout[3]. Originally "born out of frustration"[4]—according to the author—with programmers devising their own (poor quality) languages intended to be embedded into applications, Tcl gained acceptance on its own. It is commonly used for rapid prototyping, scripted applications, GUIs and testing. Tcl is used on embedded systems platforms, both in its full form and in several other small-footprinted versions. Tcl is also used for CGI scripting and even in esoteric applications as the scripting language for the Eggdrop bot. Tcl is popularly used today in many automated test harnesses, both for software and hardware, and has a loyal following in the Network Testing and SQA communities.
> 
> The combination of Tcl and the Tk GUI toolkit is referred to as Tcl/Tk.




*Tcl Man(ual) pages:*
http://www.tcl.tk/man/


*Tutorials linked from:*
http://wiki.tcl.tk/20796



> http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
> A Tcl 8.5 tutorial written by Clif Flynt, Neil Madden, Arjen Markus, David Welton and others.
> It was written with the goal of helping you to learn Tcl. It is aimed at those who have some knowledge of programming, although you certainly don't have to be an expert.
> The tutorial is intended as a companion to the Tcl manual pages which provide a reference for all Tcl commands.





> http://www.tkdocs.com/
> A Tk 8.5 best practices tutorial and documentation web site by Mark Roseman





> http://en.wikibooks.org/wiki/Programming:Tcl
> A wiki book written by Richard Suchenwirth





> http://www.invece.org/tclwise/index.html
> A portion of the print book written by Salvatore Sanfilippo is available online. This book is an introduction to the main ideas of the Tcl programming language: If you wish to learn a simple and powerful programming language, this book is for you.





> http://www.bin-co.com/tcl/tutorial/contents.php
> An online tutorial written by Binny V Abraham.




*"Tcl Code Snippets" Search on Google:*
http://www.google.com/search?q=tcl+code+snippets&ie=utf-8&oe=utf-8&aq=t


*Comparisons:*



> Tcl & Python
> http://wiki.tcl.tk/13413



More to come as I find them!


----------



## Clement (Feb 17, 2010)

*HelloWorld.tcl Example*

*HelloWorld.tcl*

```
#!/usr/bin/env tclsh
#
# A simple Hello world in tcl
#
puts "Hello World!"
```

*How to execute in a *nix environment:*
**For both instances below the tclsh interpretor MUST be in your current PATH Environment Variable**
**For most* versions of linux this is done for you**
**If you get an error similar to "command 'tclsh' not found" tclsh is not in your current PATH environment variable**


Without adding the executable flag to HelloWorld.tcl:

```
$ tclsh HelloWorld.tcl
```


Add the executable flag to HelloWorld.tcl:

```
$ chmod +x HelloWorld.tcl
$ ./HelloWorld.tcl
```


By reading the tutorials above you may learn the other ways to execute a Tcl script.
I will post Windows instructions when I find them.


----------



## Clement (Feb 18, 2010)

I am considering working on an IDE for tcl, in tcl.


----------

