Tcl-110: Introduction to Tcl/Tk
Introduces Tcl/Tk.
Describes why and where Tcl is being used, the language's strengths, and
tools for learning, programming, and debugging Tcl code.
Introduces Tcl syntax, substitution rules and basic commands.
Example: Build a GUI calculator with 30 lines of code.
- An overview of Tcl/Tk
- Discussion of Tcl/Tk features
- Discussion of Tcl/Tk command syntax
- Describe Tcl variables, assignment, loop commands,
- Describe Tcl/Tk development tools
- List resources for learning and extending Tcl/Tk
- Demonstrate building a Tcl/Tk application
set |
expr |
for |
append |
exit |
button widget |
foreach |
label |
widget grid |
Tcl-120: Tcl as Glue
Introduces using Tcl/Tk as a wrapper for other programs,
starting and retrieving input from the slave tasks, and displaying the output.
Example: button bar to automate and organize tasks.
- Tcl/Tk and Large Program Management
- Describe the Tcl list variables
- Introduce Local/Global variable Scope
- How to create Tcl procedures with a fixed number of parameters
- How to create Tcl procedures with default values
- How to create Tcl procedures that accept an undefined number of parameters
- Invoking new programs from a Tcl script
- Retrieving status and output from child tasks
- Displaying large amounts of text
file commands |
scrollbar widget |
text widget |
eval |
proc |
toplevel widget |
exec |
list commands |
file selector widget |
source |
cd |
more grid options |
switch |
Tcl-131: String Manipulation with Tcl/Tk for web/network engineers
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Example: A web robot that will download an html page,
parse the page, retrieve a selected item from the page and
display a downloaded image on a canvas.
- Large Program Management with Tcl/Tk
- Using package and namespace
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
- Introduce the canvas widget
string commands |
regexp |
regsub |
http package |
canvas widget |
image widget |
Tcl-133: String Manipulation with Tcl/Tk for testing applications
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Introduces the expect
extension to Tcl.
Example: An automated email help robot that will invoke the Unix/Linux
mail program to read mail, parse for patterns, and send replies.
- More Tcl/Tk and Large Program Management
- Using package and namespace
- Local/Global Scope
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
string commands |
regexp |
regsub |
spawn |
expect |
exp_send |
max_match |
Tcl-141: Tcl I/O: Using files, pipes and sockets for web/network engineers
Introduces Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
More techniques for using the canvas are described.
Example: Using the socket commands to create a client/server
shared-whiteboard groupware project application.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
- Creating a canvas
- Creating items on a Tk canvas
- Manipulating the items on a canvas
array set/get/names |
client and server sockets |
fileevent |
canvas widget |
scrollbar widget |
Complex client/server architecture |
Tcl-143: Tcl I/O: Using files, pipes and sockets, router test harness
Introduces Tcl input/output. The lecture discusses reading and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
The use of the Expect extension is reviewed and expanded on.
Example is a test harness that runs multiple tests on a simulated
router. The harness, tests and the techniques used to simulate the
router are described.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
array set/get/names |
client and server sockets |
Expect debugging |
Expect timeout and buffer size |
Using the expect_out associative array |
fileevent |
Tcl-150: Advanced Tcl/Tk : dicts, ensembles, {*}
Several new features were added in Tcl 8.5 and 8.6. This lecture
provides an overview of the features and how to use them.
Example: Organizing data using dicts
and distributing
the data via sockets.
- dict
- namespace ensemble
- the expansion operator
dict commands |
using namespace ensemble |
Object Oriented techniques |
socket |
puts |
gets |
Tcl-210: Tcl Introspection
Shows how the
uplevel and upvar commands are used with
associative arrays.
Discusses the variable tracing, binding, and event scheduling.
Example: Describes how a GUI can be attached to a piece of code
that has no GUI components using variable tracing and bind to monitor
and control the code behavior.
- Using the info command to examine the interpreter state.
- Creating dynamic procedures with the info command.
- Using the trace variable command to examine or modify data.
- Using the uplevel and upvar commands.
- Using the bind and canvas bind commands
info |
upvar |
uplevel |
bind |
trace |
after |
catch |
errorInfo |
error |
Tcl-230: Advanced Regular Expressions.
Discusses the new Advanced and Extended
regular expression features introduced with Tcl8.1.
- Controlling the number of matches to a pattern
- Class definitions
- Constraints
- Basic regular expressions
- Advanced regular expression rules
- Extended regular expression rules
parenthesized expressions |
new regexp command options |
alpha, upper, lower, etc classes |
?, {X}, {X,Y} modifiers |
'backslash' escape constraints |
Tcl-232: Intro to Relational DBs with OraTcl
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the OraTcl extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with oraTcl
oralogon |
oraopen |
orasql |
orafetch |
oraclose |
Tcl-240: Procedure control with expect
Introduces the Expect
extension, how to control one or more child processes with expect,
reviews string commands and regular expressions.
Example: An email robot
that uses expect and the mail program to read mail, parse for
patterns, and automaticly send replies.
- Starting the expect interpreter
- Starting child tasks
- Sending data to child tasks
- Receiving data from child tasks
- Parsing with string commands
- Parsing with regular expressions
string commands |
expect |
timeout |
regexp |
exp_send |
max_match |
regsub |
spawn |
exp_internal |
expect_out |
Tcl-260: Procedure control with DDE
This lecture describes initiating and interacting with child
processes on a Windows platform using the
open
,
exec
command and
dde
commands.
String processing with format
and scan
are discussed.
Example: Starting Excel, loading a spreadsheet, reading data from it,
and generating a simple graph.
- Starting the expect interpreter
- Starting child tasks
- Sending data to child tasks
- Receiving data from child tasks
- Parsing with string commands
- Parsing with regular expressions
open |
exec |
format |
scan |
dde connect |
dde exec |
dde poke |
dde request |
Tcl-305: Intro to Tcl-00
This session introduces the Tcl-OO package for
object oriented programming in Tcl 8.5 and newer.
Object oriented concepts including classes, objects, inheritance,
and containers are introduced.
An object oriented card game is built as an example.
- Programming language families
- Features of Object Oriented languages
- Constructing classes
- Composition/has-a relationships
- Class and Object methods
- Class introspection techniques
- Creating new objects
defining a class |
creating an object |
invoking methods |
superclass inheritance |
mixin additions |
scope |
Tcl-315: Intermediate TclOO
This session describes more techniques and procedures for
working with TclOO and object oriented programming in Tcl.
It expands on the information in Tcl-305.
Inheritance, composition and the relationship between Tcl global
variables, object variables and the Tk widgets are discussed.
The classes used in the example from Tcl-305 are extended with
inheritance and composition to create a graphical solitaire card game.
- Aggregation, Composition and Inheritance
- Single and multiple inheritance
- Namespaces and scoping rules
- The
my
operator
class |
inherit |
scope |
variable |
namespace current |
namespace code |
info |
Tcl-325: Advanced Tk: Creating megawidgets in namespaces
This lecture expands on the
namespace
material presented in
lecture Tcl-220 to demonstrate using namespaces with Tk to create new
compound widgets that present a single interface to the user.
The lecture expands previous coverage of Tk's object oriented aspects,
and introduces several more Tk widgets.
The example shows how to build an icon-based button selector to
change modes in an application, similar to the iconic task bars in
Windows applications.
Topics covered include:
- Using the frame widget
- Selection widgets - listbox, checkbutton, radiobutton and menu
- Megawidgets for use in a single application
- Megawidgets for reuse in multiple applications
rename |
namespace code |
frame |
radiobutton |
checkbutton |
menubutton |
menu |
listbox |
Tcl-350: CGI Programming with tcl
Explains how to use the cgi.tcl package from NIST to construct
Tcl cgi applications.
Covers generating HTML pages and using CGI scripts to acquire
input from users and track cookies.
Example:
- Layout of a cgi.tcl script
- Font control commands
- List commands
- Table commands
- Form commands
- Accessing input
- Using cookies
- Setting a cookie
- Accessing cookies
cgi_cookie_list |
cgi_import_cookie |
cgi_cookie_set |
cgi_cookie_get |
cgi_eval |
cgi_debug |
cgi_head |
cgi_title |
cgi_body |
cgi_h# |
cgi_puts |
cgi_p |
cgi_br |
cgi_img |
cgi_bold |
cgi_number_list |
cgi_bullet_list |
cgi_li |
cgi_table |
cgi_table_row |
cgi_table_data |
cgi_form |
cgi_submit_button |
cgi_select |
cgi_option |
cgi_checkbox |
cgi_radio_button |
cgi_input |
cgi_import_list |
cgi_import |
cgi_import_as |
Tcl-370: Co-Routines in Tcl
Introduce coroutines and the Tcl commands to control them.
Describe the Tcl coroutine command.
- Create coroutines
- Return data from coroutines
- How to use yield
- How to use yieldto
- How to use return
- When and why to use coroutines
coroutine |
yield |
yieldto |
return |
Tcl-115: Introduction to Embedded Tcl
Many applications embed Tcl as an internal scripting language.
This lecture series is designed to provide users of those applications
with the information they need to fully utilize these applications.
Describes why and where Tcl is being used, the language's strengths, and
tools for learning, programming, and debugging Tcl code.
Introduces Tcl syntax, substitution rules and basic commands.
Example: Generate a table of distances between points
- An overview of Tcl/Tk
- Discussion of Tcl/Tk features
- Discussion of Tcl/Tk command syntax
- Describe Tcl variables, assignment, loop commands,
- Describe Tcl/Tk development tools
- List resources for learning and extending Tcl/Tk
- Demonstrate building a Tcl/Tk application
set |
expr |
for |
append |
foreach |
puts |
Tcl-125: File Access with Embedded Tcl
Expands on Tcl with commands to interact with the file system,
load and process data from files, construct procedures and libraries.
Example: Read a data file and reformat it.
- Tcl/Tk and Large Program Management
- Describe the Tcl list variables
- Introduce Local/Global variable Scope
- How to create Tcl procedures with a fixed number of parameters
- How to create Tcl procedures with default values
- How to create Tcl procedures that accept an undefined number of parameters
- Invoking new programs from a Tcl script
- Retrieving status and output from child tasks
- Displaying large amounts of text
file commands |
open |
gets |
read |
puts |
proc |
list commands |
exec |
format |
source |
cd |
switch |
Tcl-132: String Manipulation with Tcl/Tk for business/database specialists
This session introduces methods for parsing strings using
Tcl's list, string and regular expression support.
Discusses parsing data from flat ascii report
files and generating formatted reports from database files.
Example: Parsing report data and generating a barchart.
- More Tcl/Tk and Large Program Management
- Using package and namespace
- Local/Global Scope
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
string commands |
regexp |
regsub |
format command |
canvas widget |
TclODBC |
Tcl-135: String Manipulation for Embedded Tcl applications
This session introduces methods for parsing strings using
Tcl's string and regular expression support.
Example: Extracting a subset of data from a report and reformatting it.
- More Tcl/Tk and Large Program Management
- Using package and namespace
- Local/Global Scope
- Parsing with string commands
- Parsing with regular expressions
- regular expression syntax
string commands |
regexp |
regsub |
format |
Tcl-142: Tcl I/O: Using files, pipes and sockets for business/database specialists
Introduces Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
Example: A Client/Server layer over Microsoft Access,
that displays client activity with a real-time barchart.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Configuring a channel
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
- Creating a canvas
- Creating items on a Tk canvas
- Manipulating the items on a canvas
array set/get/names |
client and server sockets |
fileevent |
canvas widget |
scrollbar widget |
TclODBC connection to a database engine |
Tcl-145: Tcl I/O: More file, pipe and socket I/O
Expands on simple Tcl input/output. The lecture discusses reading
and writing to files, sockets and other programs.
The Tcl associative array is introduced, with examples describing
how it can be used to simplify a project.
Example: Using the socket commands to create a client/server
to monitor a remote device.
- Client/Server Architecture in Tcl
- stdin and stdout
- File channels
- Sockets
- Commands for manipulating associative array elements.
- Commands for manipulating entire associative arrays.
- Techniques for data organization with naming conventions.
array set |
array get |
array names |
client and server sockets |
pipes |
fileevent |
client/server architecture |
Tcl-199: Review for experienced Tcl/Tk programmers
This lecture presents a quick overview of the Tcl material covered in
the other 100 series lectures. It's designed for programmers with 2-12
months of self-taught experience with Tcl.
The basic commands are introduced, with discussion of the
less obvious features of the commands that new Tcl users may be
unaware of.
Substitution rules are described in detail.
Topics covered include:
- Decision commands -
if, switch
- The Tcl loop commnds -
for, foreach
- Creating and using procedures in Tcl
- The Tcl data structures: simple variables, lists and arrays
- Tcl string processing commands
- Glob rules
- Regular Expressions
- Tcl file I/O
- Error handline
if |
switch |
for |
foreach |
proc |
array set |
array get |
array names |
lindex |
string |
format |
regexp |
regsub |
open |
puts |
exec |
gets |
eval |
error |
errorInfo, errorCode |
catch |
Tcl-220: Modularization: source, package and namespaces
Describes the details
of using the packages and namespaces, how to organize code modules,
create index files, and find packages.
Example: A Tower of Hanoi game using namespaces to create
private stack data structures for each post.
- The source command
- Using packages
- Creating a package
- Package numbering conventions
- Using a procedures within a namespace
- Creating a namespace
source |
package |
namespace |
pkg_mkIndex |
import |
export |
pkgIndex.tcl |
auto_path |
init.tcl |
Tcl-231: Intro to Relational DBs with Sybase
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the SybTcl extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with sybTcl
sybconnect |
sybuse |
sybsql |
sybnext |
sybcols |
sybcancel |
sybclose |
Tcl-233: Intro to Relational DBs with TclODBC
This lecture explains what relational databases are and how to
use the SQL language to create and modify database tables.
The lecture describes either the TclODBC extension
to the Tcl language.
Example: Convert data from a generic ASCII report to a set of
relational tables.
- Vocabulary overview
- What is SQL
- Introduce the essential subset of the SQL language
- Create Table
- Insert
- Select
- Delete
- Update
- Using SQL with TclODBC and MS-SQL.
database connect |
database configure |
evaluate SQL commands |
processing row data |
database disconnect |
Tcl-250: Web Programming with Apache and Tcl
Introduces the basics of what a web server is and how to configure
an Apache server.
Introduces cgi.tcl.
Example: A simple page counter.
- What is a web server
- Directory layout
- Configuration options
- CGI introduction
httpd daemon |
http client/server interaction |
httpd.conf file |
html, bin, cgi-bin, htdocs, icons and man directories |
CGI environment variables |
GET and POST methods |
Tcl-290: Constructing a Tcl Extension
Explains how to build a Tcl extension with the C programming language.
Describes the required C files and functions, function and file naming
conventions, creating a makefile for VC++ or Linux/Unix and
the Tcl functions that support extensions.
Example: A checksum extension.
- Reasons for building extensions
- Extension components
- Functional aspects of an extension
- Implementation details of an extension
- Transfering data between Tcl scripts and C code extensions
- Transfering status information between Tcl scripts and C code extensions
- Naming conventions
extension_Init |
Tcl_NewIntObj |
Tcl_SetObjResult |
Tcl_WrongNumArgs |
Tcl_NewDoubleObj |
Tcl_PkgProvide |
Tcl_SetVar |
Tcl_NewStringObj |
Tcl_CreateObjCommand |
Tcl-310: Intro to Incr Tcl
This session introduces the
[incr Tcl]
extension for
object oriented programming in Tcl.
Object oriented concepts including classes, objects, inheritance,
containers and protection are introduced.
An object oriented card game is built as an example.
- Programming language families
- Features of Object Oriented languages
- Constructing classes
- Composition/has-a relationships
- Class and Object methods
- Class introspection techniques
- Incr Tcl variable protection levels
class |
body |
configure |
variable |
cget |
info |
Tcl-320: Intermediate Incr Tcl
This session describes more techniques and procedures for
working with
[incr Tcl]
and object oriented programming in Tcl.
It expands on the information in Tcl-310.
Inheritance, composition and the relationship between Tcl global
variables, object variables and the Tk widgets are discussed.
The classes used in the example from Tcl-310 are extended with
inheritance and composition to create a graphical solitaire card game.
Topics discussed include:
- Aggregation, Composition and Inheritance
- Single and multiple inheritance
- Variable inheritance
- Namespaces and scoping rules
- The
$this
variable
class |
inherit |
scope |
variable |
namespace current |
namespace code |
info |
Tcl-335: Using the Tcl slave interpreter
Explains how to use the Tcl interp command to create new
slave interpreters.
Example: An agent-style client-server application to evaluate
suspect code in a safe manner.
- Starting a child interpreter
- Starting a safe child interpreter
- Evaluating commands within the interpreter
- Mapping procedures between slave interpreters
interp |
interp -safe |
interp eval |
interp alias |
Tcl-360: Tcl and XML
Introduces the XML language and the Tcl-XML and tclexpat packages for parsing XML
documents.
Describes the layout of an XML document and the DocType DTD.
Examples describe parsing and validating XML documents using a DTD
and internal tags or attributes
- Describes components of an XML Document
- Describes XML tags
- Describes components of an XML DTD
- How to load tclexpat
- How to load Tcl-XML
- Parsing documents with tclexpat and Tcl-XML
creating a parser |
confirming a document is well-formed |
parsing a document |
confirming a document is valid |
parsing a DTD |