Search Perform an advanced search query SOFTPEDIA
 
SOFTPEDIA
Updated one minute ago
HomeSubmit a program for being reviewedAdvertise on our websiteGet help on surfing our websitesSend us your feedbackGet information about our XML/RSS backend and how to use itBrowse the news archiveVisit our discussion forumVizitati forumul in limba romana



Program Finder

Tcl/Tk 8.5.3 / 8.6 Alpha 1

Download Tcl/Tk 8.5.3 / 8.6 Alpha 1
Add to download basket
Send update information
Rating: NOT RATED
Rated by: 29 user(s)

Recent news
- Brian Lara International Cr...
- Civilization IV: Colonizati...
- Major League Baseball 2K7 A...
- Flipswap Can Trade Your Bro...
- Brian Lara International Cr...
- PreFab Event Taps Testbench...
- Star Wars Galaxy Is Five Ye...
- You Can Beta Test Stone Age...
- Breath of Fire: Dragon Quar...
- The First Xperia X1 Clone i...

Downloads: 7,573
Developer: Tcl Core Team | More programs by this producer
License: BSD License
Price: FREE 
Last Updated: July 2nd, 2008 02:00
Category: MAIN :: Programming :: Interpreters
 Read user reviews (0) Add a review Refer to friend Subscribe

Tcl Tk description Download
Tcl provides a portable scripting environment for Unix, Windows, and Macintosh that supports string processing and pattern matching, native file system access, shell-like control over other programs, TCP/IP networking, timers, and event-driven I/O.

Tcl has traditional programming constructs like variables, loops, procedures, namespaces, error handling, script packages, and dynamic loading of DLLs. Tk provides portable GUIs on UNIX, Windows, and Macintosh.

A powerful widget set and the concise scripting interface to Tk make it a breeze to develop sophisticated user interfaces.

Tcl (Tool Command Language) is easy to learn and you can create a useful program in minutes! You are free to use Tcl/Tk however you wish, even in commercial applications.

Basic Syntax

Tcl scripts are made up of commands separated by newlines or semicolons. Commands all have the same basic form illustrated by the following example:

expr 20 + 10

This command computes the sum of 20 and 10 and returns the result, 30. You can try out this example and all the others in this page by typing them to a Tcl application such as tclsh; after a command completes, tclsh prints its result.

Each Tcl command consists of one or more words separated by spaces. In this example there are four words: expr, 20, +, and 10. The first word is the name of a command and the other words are arguments to that command. All Tcl commands consist of words, but different commands treat their arguments differently. The expr command treats all of its arguments together as an arithmetic expression, computes the result of that expression, and returns the result as a string. In the expr command the division into words isn't significant: you could just as easily have invoked the same command as

expr 20+10

However, for most commands the word structure is important, with each word used for a distinct purpose.

All Tcl commands return results. If a command has no meaningful result then it returns an empty string as its result.

Variables

Tcl allows you to store values in variables and use the values later in commands. The set command is used to write and read variables. For example, the following command modifies the variable x to hold the value 32:

set x 32

The command returns the new value of the variable. You can read the value of a variable by invoking set with only a single argument:

set x

You don't need to declare variables in Tcl: a variable is created automatically the first time it is set. Tcl variables don't have types: any variable can hold any value.

To use the value of a variable in a command, use variable substitution as in the following example:

expr $x*3

When a $ appears in a command, Tcl treats the letters and digits following it as a variable name, and substitutes the value of the variable in place of the name. In this example, the actual argument received by the expr command will be 32*3 (assuming that variable x was set as in the previous example). You can use variable substitution in any word of any command, or even multiple times within a word:

set cmd expr
set x 11
$cmd $x*$x

Command substitution

You can also use the result of one command in an argument to another command. This is called command substitution:

set a 44
set b [expr $a*4]

When a [ appears in a command, Tcl treats everything between it and the matching ] as a nested Tcl command. Tcl evaluates the nested command and substitutes its result into the enclosing command in place of the bracketed text. In the example above the second argument of the second set command will be 176.

Quotes and braces

Double-quotes allow you to specify words that contain spaces. For example, consider the following script:

set x 24
set y 18
set z "$x + $y is [expr $x + $y]"

After these three commands are evaluated variable z will have the value 24 + 18 is 42. Everything between the quotes is passed to the set command as a single word. Note that (a) command and variable substitutions are performed on the text between the quotes, and (b) the quotes themselves are not passed to the command. If the quotes were not present, the set command would have received 6 arguments, which would have caused an error.

Curly braces provide another way of grouping information into words. They are different from quotes in that no substitutions are performed on the text between the curly braces:

set z {$x + $y is [expr $x + $y]}

This command sets variable z to the value "$x + $y is [expr $x + $y]".

Control structures

Tcl provides a complete set of control structures including commands for conditional execution, looping, and procedures. Tcl control structures are just commands that take Tcl scripts as arguments. The example below creates a Tcl procedure called power, which raises a base to an integer power:

proc power {base p} {
set result 1
while {$p > 0} {
set result [expr $result * $base]
set p [expr $p - 1]
}
return $result
}

This script consists of a single command, proc. The proc command takes three arguments: the name of a procedure, a list of argument names, and the body of the procedure, which is a Tcl script. Note that everything between the curly brace at the end of the first line and the curly brace on the last line is passed verbatim to proc as a single argument. The proc command creates a new Tcl command named power that takes two arguments. You can then invoke power with commands like the following:

power 2 6
power 1.15 5

When power is invoked, the procedure body is evaluated. While the body is executing it can access its arguments as variables: base will hold the first argument and p will hold the second.

The body of the power procedure contains three Tcl commands: set, while, and return. The while command does most of the work of the procedure. It takes two arguments, an expression ($p > 0) and a body, which is another Tcl script. The while command evaluates its expression argument using rules similar to those of the C programming language and if the result is true (nonzero) then it evaluates the body as a Tcl script. It repeats this process over and over until eventually the expression evaluates to false (zero). In this case the body of the while command multiplied the result value by base and then decrements p. When p reaches zero the result contains the desired power of base. The return command causes the procedure to exit with the value of variable result as the procedure's result.

Here are some key features of "Tcl Tk":

ˇ More control structures, such as if, for, foreach, and switch.
ˇ String manipulation, including a powerful regular expression matching facility. Arbitrary-length strings can be passed around and manipulated just as easily as numbers.
ˇ I/O, including files on disk, network sockets, and devices such as serial ports. Tcl provides particularly simple facilities for socket communication over the Internet.
ˇ File management: Tcl provides several commands for manipulating file names, reading and writing file attributes, copying files, deleting files, creating directories, and so on.
ˇ Subprocess invocation: you can run other applications with the exec command and communicate with them while they run.
ˇ Lists: Tcl makes it easy to create collections of values (lists) and manipulate them in a variety of ways.
ˇ Arrays: you can create structured values consisting of name-value pairs with arbitrary string values for the names and values.
ˇ Time and date manipulation.
ˇ Events: Tcl allows scripts to wait for certain events to occur, such as an elapsed time or the availability of input data on a network socket.

What's New in 8.5.3 Stable Release:

ˇ Corrected unreliable [fcopy] callbacks and enabled bidirectional fcopy.
ˇ Support Tcl Module packages in a Safe Base interp.
ˇ Fixed [slave bgerror] to operate in slave, not master.
ˇ Fixed crash when a ttk::label gets width or height of zero.
ˇ Fixed crash in [chan postevent].
ˇ Fixed crash in [dict append].
ˇ Fixed crash in [glob -dir {} a].
ˇ Fixed crash in Tk_ParseArgv().
ˇ Fixed crash in a global [grab].
ˇ Fixed [tell] overflow on large files.
ˇ Fixed missing events on canvas items.
ˇ Made Tk more robust when Tcl and Xlib disagree about system encoding.
ˇ Improved Solaris support for DTrace and 64 bit.
ˇ Fixed floating point rounding on Solaris/x86.

What's New in 8.6 Alpha 1 Development Release:

ˇ New commands were added for supporting object oriented programming and providing script-level access to the stacked channels mechanism.
ˇ [binary] is now a [namespace ensemble].
ˇ A new visual styles element engine was provided for Tk on Windows.
ˇ Writing GIF images now uses real LZW compression.


Tcl Tk Download
Tcl Tk Screenshots
Find Related Downloads



MOST POPULAR PROGRAMS IN THIS CATEGORY ( Interpreters )  

Gambas 2 2.7
Gambas is a basic graphical development environment.
screenshot
update
Tcl/Tk 8.5.3 / 8.6 Alpha 1
Tcl/Tk is a portable scripting environment for Unix, Windows, and Macintosh.
screenshot
update
R 2.7.1
R is a language and environment for statistical computing.
screenshot
update
Jess 7.1 RC1
Jess is the programmer's rule engine for the Java platform.
screenshot
update
Python 2.5.2 / 3.0a4
Python is a high-level scripting language.
screenshot
pick | update
ScummVM 0.11.1
ScummVM is a cross-platform interpreter for several point-and-click adventure engines.
screenshot
pick | update
Flex 2.5.35
Flex is a Fast Lexical Analyzer.
screenshot
update

go to top  



Welcome!
Hello, Guest

Login if you have a Softpedia.com account.

Otherwise, register for one.

Main categories:
  • Adaptive Technologies
  • Adobe AIR Apps
  • Artistic Software
  • Communications
  • Database
  • Desktop Environment
  • Documentation
  • Education
  • Games
  • Home Automation
  • Information Management
  • Internet
  • Multimedia
  • Office
  • Printing
  • Programming
  • Religion
  • Science
  • Science and Engineering
  • Security
  • System
  • Text Editing&Processing
  • Utilities

  • Week's best:
  • Softpedia Linux RSS ...
  • Ubuntu 8.04.1 (Hardy...
  • Pidgin 2.4.3
  • Adobe Flash Player f...
  • The Gimp 2.4.6 / 2.5...
  • openSUSE Linux 11.0
  • Linux Kernel 2.6.25....
  • Super Grub Disk 0.97...
  • Skype 2.0.0.68
  • OpenOffice.org 2.4.1...
  • Mozilla Firefox 3.0 ...
  • Transmission 1.22
  • DeVeDe 3.9
  • Wine 1.1.0
  • wine-doors 0.1.2
  • Shoreline Firewall 4...
  • Linux Mint 5.0 (Elys...
  • Google Gadgets 0.9.3
  • Fedora 9
  • Opera 9.51
  • Latest Distributions
  • GoblinX Micro Editio...
  • Clonezilla-SysRescCD...
  • SchilliX 0.6.7
  • PING 2.01.13
  • Edubuntu 8.04.1 (Har...
  • Gobuntu 8.04.1 (Hard...
  • Ubuntu JeOS 8.04.1 (...
  • Xubuntu 8.04.1 (Hard...
  • Ubuntu Studio 8.04.1...
  • MythBuntu 8.04.1
  • Kubuntu 8.04.1 (Hard...
  • Kubuntu 8.04.1 (Hard...
  • Caixa Mágica 12 Live...
  • Greenie Linux 3.0.4H
  • Ubuntu 8.04.1 (Hardy...
  • Pardus Linux 2008
  • Poseidon Linux 3.0
  • GParted LiveCD 0.3.7...
  • Elive 1.7.8 Developm...
  • Foresight Linux 2.0....
  • Latest Ubuntu Packages
  • LOVE 0.3.2
  • DjVuSmooth 0.1.2
  • GScrot 0.38
  • Rapache 0.4
  • Amaya 10.0 / 10.1 Pr...
  • TriX 0.94
  • Alien GUI 0.99.1
  • Listaller 0.1.16 Pre...
  • Newspost 2.1.1
  • XWii 2.5
  • Domain Technologie C...
  • FrostWire 4.13.5
  • aMSN 0.97.1
  • Ortro 1.3.2a
  • ManDVD 2.5-3
  • Yabause 0.9.6
  • Asunder 1.6
  • gtk-recordMyDesktop ...
  • recordMyDesktop 0.3....
  • © 2001 - 2008 Softpedia. All rights reserved.
    Softpedia™ and Softpedia™ logo are registered trademarks of SoftNews NET SRL.
    Copyright Information | Privacy Policy | Terms of Use | Contact Softpedia | Update your software | Archive