**Introduction** !!!!!! '''[Tcl Tutorial Index%|%Index%|%]''' | '''[Tcl Tutorial Lesson 0a%|%Next lesson%|%]''' !!!!!! Welcome to the Tcl tutorial. We wrote it 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. It is divided into brief sections covering different aspects of the language. Depending on what system you are on, you can always look up the reference documentation for commands that you are curious about. On Unix for example, `man while` would bring up the man page for the `while` command. Each section is accompanied by relevant examples showing you how to put to use the material covered. **Available lessons** ***Getting started*** [Tcl Tutorial Lesson 0%|%Introduction%|%] [Tcl Tutorial Lesson 0a%|%Running Tcl%|%] [Tcl Tutorial Lesson 1%|%Simple Text Output%|%] [Tcl Tutorial Lesson 2%|%Assigning values to variables%|%] [Tcl Tutorial Lesson 3%|%Evaluation and Substitutions 1: Grouping arguments with ""%|%] [Tcl Tutorial Lesson 4%|%Evaluation and Substitutions 2: Grouping arguments with {}%|%] [Tcl Tutorial Lesson 5%|%Evaluation and Substitutions 3: Grouping arguments with [[]]%|%] [Tcl Tutorial Lesson 6%|%Results of a command - Math 101%|%] [Tcl Tutorial Lesson 6a%|%Computers and Numbers%|%] ***Flow Control*** [Tcl Tutorial Lesson 7%|%Numeric Comparisons 101 - if%|%] [Tcl Tutorial Lesson 8%|%Textual Comparison - switch%|%] [Tcl Tutorial Lesson 9%|%Looping 101 - While loop%|%] [Tcl Tutorial Lesson 10%|%Looping 102 - For and incr%|%] [Tcl Tutorial Lesson 11%|%Adding new commands to Tcl - proc%|%] [Tcl Tutorial Lesson 12%|%Variations in proc arguments and return values%|%] [Tcl Tutorial Lesson 13%|%Variable scope - global and upvar%|%] ***Data Types*** [Tcl Tutorial Lesson 14%|%Tcl Data Structures 101 - The list%|%] [Tcl Tutorial Lesson 15%|%Adding and Deleting members of a list%|%] [Tcl Tutorial Lesson 16%|%More list commands - lsearch, lsort, lrange%|%] [Tcl Tutorial Lesson 16a%|%Simple pattern matching - "globbing"%|%] [Tcl Tutorial Lesson 17%|%String Subcommands - length index range%|%] [Tcl Tutorial Lesson 18%|%String comparisons - compare match first last wordend%|%] [Tcl Tutorial Lesson 19%|%Modifying Strings - tolower, toupper, trim, format%|%] [Tcl Tutorial Lesson 20%|%Regular Expressions 101%|%] [Tcl Tutorial Lesson 20a%|%More Examples Of Regular Expressions%|%] [Tcl Tutorial Lesson 21%|%More Quoting Hell - Regular Expressions 102%|%] [Tcl Tutorial Lesson 22%|%Associative Arrays%|%] [Tcl Tutorial Lesson 23%|%More On Arrays - Iterating and use in procedures%|%] [Tcl Tutorial Lesson 23a%|%Dictionaries%|%] ***Input and Output*** [Tcl Tutorial Lesson 24%|%File Access 101%|%] [Tcl Tutorial Lesson 35%|%Changing Working Directory - cd, pwd%|%] [Tcl Tutorial Lesson 25%|%Information about Files - file, glob%|%] [Tcl Tutorial Lesson 26%|%Running other programs from Tcl - exec, open%|%] [Tcl Tutorial Lesson 40%|%Channel I/O: socket, fileevent, vwait%|%] [Tcl Tutorial Lesson 42%|%More channel I/O - fblocked and fconfigure%|%] [Tcl Tutorial Lesson 26a%|%Communicating with other programs - socket, fileevent%|%] [Tcl Tutorial Lesson 41%|%Time and Date - clock%|%] [Tcl Tutorial Lesson Databases%|%Using databases%|%] ***Introspection, Debugging and Performance*** [Tcl Tutorial Lesson 27%|%Learning the existence of commands and variables - info%|%] [Tcl Tutorial Lesson 28%|%State of the interpreter - info%|%] [Tcl Tutorial Lesson 29%|%Information about procs - info%|%] [Tcl Tutorial Lesson 36%|%Debugging and Errors - errorInfo errorCode catch error return%|%] [Tcl Tutorial Lesson 37%|%More Debugging - trace%|%] [Tcl Tutorial Lesson 39%|%Timing scripts%|%] ***Modularization and Code Reuse*** [Tcl Tutorial Lesson 30%|%Modularization - source%|%] [Tcl Tutorial Lesson 31%|%Building reusable libraries - packages and namespaces%|%] [Tcl Tutorial Lesson APP%|%Building and distributing applications%|%] ***Cooperating with the interpreter*** [Tcl Tutorial Lesson 32%|%Creating Commands - eval%|%] [Tcl Tutorial Lesson 33%|%More command construction - format, list%|%] [Tcl Tutorial Lesson 34%|%Substitution without evaluation - format, subst%|%] [Tcl Tutorial Lesson 38%|%Command line arguments and environment strings%|%] [Tcl Tutorial Lesson 43%|%Child interpreters%|%] ***Programming techniques*** [Tcl Tutorial Lesson OOP1%|%Object-oriented programming 101%|%] [Tcl Tutorial Lesson OOP2%|%More on object-oriented programming%|%] [Tcl Tutorial Lesson CORO%|%Programming with coroutines%|%] ***Additional Resources*** The Tcl community is an exceedingly friendly one. It's polite to try and figure things out yourself, but if you're struggling, we're more than willing to help. Here are some good places to get help: * The comp.lang.tcl newsgroup. Accessible via a newsreader, or Google Groups. * The [http://www.tcl-lang.org%|%Tcl developer site%|%] brings a great many resources together, ranging from basic tutorials to advanced development. * The [http://wiki.tcl-lang.org%|%Wiki%|%] has a great deal of useful code, examples and discussions of the finer points of Tcl usage. * If you need help right away, there is often someone on the #tcl channel on irc.freenode.net who can help you out, but please don't be impatient if no one can help you instantly - if you need that level of support, consider hiring a consultant. * There are several recommended books for those who wish to gain more in-depth knowledge of Tcl. [Clif Flynt], the original author of this tutorial is also the author of [BOOK: Tcl/Tk: A Developer's Guide%|%Tcl/Tk: A Developer's Guide%|%]. Other popular books: [BOOK Practical Programming in Tcl and Tk%|%Practical Programming in Tcl and Tk%|%]. More can be found via the page for [Online books] on the Wiki. A recent book on Tcl, one that describes the latest features, is [BOOK The Tcl Programming Language%|%The Tcl Programming Language%|%] by [Ashok P. Nadkarni]. ***Credits*** Thanks first and foremost to [Clif Flynt] for making his material available under a BSD license. The following people also contributed: * [Neil Madden] * [Arjen Markus] * [David Welton] Of course, we also welcome comments and suggestions about how it could be improved - or if it's great the way it is, we don't mind a bit of thanks, either! !!!!!! '''[Tcl Tutorial Index%|%Index%|%]''' | '''[Tcl Tutorial Lesson 0a%|%Next lesson%|%]''' !!!!!!