Tcl/Tk
iii
Whitespace in Tcl ................................................................................................................................ 11
5. TCL – COMMANDS ........................................................................................................... 12
Command Substitution ........................................................................................................................ 13
Variable Substitution ........................................................................................................................... 13
Backslash Substitution ......................................................................................................................... 13
6. TCL – DATA TYPES ............................................................................................................ 14
Simple Tcl Objects ............................................................................................................................... 14
String Representations ........................................................................................................................ 15
List ....................................................................................................................................................... 15
Associative Array ................................................................................................................................. 16
Handles ............................................................................................................................................... 16
7. TCL – VARIABLES .............................................................................................................. 17
Variable Naming .................................................................................................................................. 17
Dynamic Typing ................................................................................................................................... 17
Mathematical Expressions ................................................................................................................... 18
8. TCL – OPERATORS ............................................................................................................ 20
Arithmetic Operators........................................................................................................................... 20
Relational Operators ........................................................................................................................... 22
Logical Operators ................................................................................................................................ 23
Bitwise Operators ................................................................................................................................ 25
Ternary Operator ................................................................................................................................. 27
Operators Precedence in Tcl ................................................................................................................ 27
9. TCL – DECISIONS .............................................................................................................. 30
Tcl - If Statement ................................................................................................................................. 31
Tcl – If else Statement ......................................................................................................................... 32