XPS-Q8 Tcl Manual
Table of Contents
1.0 TCP/IP Communication............................................................................... 1
2.0 Tool Command Language............................................................................ 2
2.1 Introduction ............................................................................................................................. 2
2.2 Tcl scripting language features ................................................................................................ 2
2.2.1 “Hello, World!” example ..................................................................................... 2
2.2.2 Variables .............................................................................................................. 3
2.2.3 Command Substitution ......................................................................................... 3
2.2.4 Math Expressions ................................................................................................. 4
2.2.5 Backslash Substitution ......................................................................................... 4
2.2.6 Grouping with Braces and Double Quotes ........................................................... 5
2.2.6.1 Square Brackets Do Not Group ................................................ 6
2.2.6.2 Grouping before Substitution ................................................... 6
2.2.6.3 Grouping Math Expressions with Braces ................................. 7
2.2.6.4 More Substitution Examples .................................................... 7
2.2.7 Procedures ............................................................................................................ 7
2.2.8 A Factorial Example ............................................................................................ 8
2.2.9 More about Variables ........................................................................................... 9
2.2.9.1 Funny Variable Names ............................................................10
2.2.9.2 The unset Command................................................................10
2.2.9.3 Using info exists to check whether a variable exists ...............11
2.2.10 More about Math Expressions ......................................................................... 11
2.2.11 Comments ........................................................................................................ 12
2.2.12 Substitution and Grouping Summary ............................................................... 12
2.2.13 Fine Points ....................................................................................................... 13
2.3 Reference ............................................................................................................................... 14
2.3.1 Backslash Sequences ......................................................................................... 14
2.3.2 Arithmetic Operators ......................................................................................... 14
3.0 Tcl Script Execution at Boot ...................................................................... 15
iii EDH0307En1041 — 10/17