Control Structures
Conditionals
The if
Command
- Implicit invocation of
expr
- Optional keywords (
then
, else
)
elseif
capability
The switch
Command
- Supports all pattern matching
options (
-exact
, -glob
, and
-regexp
)
--
is crucial
Iteration
The while
Command
- Implicit invocation of
expr
break
continue
The for
Command
- Modelled after C's
for
loop
- Implicit invocation of
expr
break
continue
The foreach
Command
Iteration over lists. More efficient than indexing over a list (is
able to make one pass over the list).
The loop
Command
Extended Tcl.
- A simpler (more constrained) iterator than
for
break
continue
Keith Waclena
The University of Chicago Library
This page last updated: Tue Aug 2 12:16:48 CDT 1994
This page was generated from Extended HTML by xhtml.