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

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

Serving Software Downloads in 956 Categories, Downloaded 49.482.165 Times

Tcl/Tk 8.4.15/8.5a6

  Date Added: August 17, 2010  |  Visits: 1.276

Tcl/Tk

Report Broken Link
Printer Friendly Version


Product Homepage
Download (96 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
USER REVIEWS
More Reviews or Write Review


TCL/TK RELATED
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  
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
 
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...
 
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  
Networking Tools  -  Access Point Utilities for Unix 1.5.1 pre3
Wireless Access Point Utilites for Unix is a set of utilites to configure and monitor Wireless Access Points under Unix using SNMP protocol. Utilites knownly compiles by GCC and IBM C compiler and run under Linux, FreeBSD, NetBSD, MacOS-X, AIX,...
409.6 KB  
File Synchronizers  -  TreeSize for Unix 0.53
TreeSize for Unix is a disk consumption analyzing tool, which sorts folders according to their physical occupied sizes. The perfect tool to help you obtaining more disk free space, on your hard drive, usb pen drive or even on network folders...
204.8 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  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
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  
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB