Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 31.318.600 Times

Tcl/Tk 8.4.15/8.5a6

  Date Added: August 17, 2010  |  Visits: 957


Report Broken Link
Printer Friendly Version

Product Homepage
Download (77 downloads)

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 isnt 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 dont need to declare variables in Tcl: a variable is created automatically the first time it is set. Tcl variables dont 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 procedures result..

Requirements: No special requirements
Platforms: Linux
Keyword: Command Control Structures Expr For Unix In This Interpreters Result Such As Tcl Tcltk Value Of Variable
Users rating: 0/10

License: Freeware Size: 3.1 MB
Modules  -  Information Box 2.0
This contribution allows the admin to update the text for pages in the Information Box, such as: - Shipping & Returns - Privacy Notice - Conditions of Use - Contact Us
Utilities  -  pipestatus for UNIX/POSIX shell 0.6.0
pipestatus - source file for UNIX/POSIX shell that allows to obtain an exit status of every program in a pipe.
6.39 KB  
Version Control Tools  -  GNU arch 1.3.5
GNU arch is a revision control system, similar in purpose to tools such as CVS, SCCS, and Subversion. It is used to keep track of the changes made to a source tree and to help programmers combine and otherwise manipulate changes made by multiple...
3.5 MB  
Audio Tools  -  PGID3 Tag Editor 2.02
PGID3 is an ID3v1 and v2 tag editor for manipulating the information on files such as MP3s. PGID3 Tag Editor project is written in PHP and uses PHP-GTK, so it can take advantage of the GTK+ Toolkit for rendering a GUI. The program itself is...
8.19 KB  
Security Tools  -  pam_passwdqc 1.0.2
pam_passwdqc is a simple password strength checking module for PAM-aware password changing programs, such as passwd. In addition to checking regular passwords, it offers support for passphrases and can provide randomly generated ones. All...
30.72 KB  
Programming  -  joeq virtual machine 20030812
Joeq is a virtual machine and compiler infrastructure designed to facilitate research in virtual machine technologies such as Just-In-Time and Ahead-Of-Time compilation, advanced garbage collection techniques, distributed computation,...
1024 KB  
Libraries  -  Sowa Data Capacitor 0.0.0_dev0
Sowa Data Capacitor is a unified Java API for accessing data in several different forms, such as XML, database or memory. Installation: Sowa Data Capacitor now not need any dependences (except ant), but itll propably have. To build it you...
15.36 KB  
Development Editors  -  Utilities and SDK for Subsystem for UNIX-based Applications 010.0.7063.0
Utilities and SDK for UNIX-Based Applications was developed to be an add-on to the Subsystem for UNIX-Based Applications (referred to as SUA, hence forth) component that shipped in Microsoft Windows 7/ Windows Server 2008 R2. This consists of...
FTP Clients  -  cmdftp 0.9.6
cmdftp is a command line FTP client for Unix. Features include passive mode for all data transfers, shell like transparent syntax for local and remote modes, multiple and recursive file transfers using wildcards, recursive copy and move...
122.88 KB  
Networking Tools  -  Speak Freely for Unix 7.6.a
Speak Freely is an application for Unix and Unix-like systems (Linux, FreeBSD, IRIX, etc.) with audio hardware, which allows you to talk (actually send voice, not typed characters) over a network. Speak Freely for Unix uses the workstation audio...
778.24 KB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB