for {set i 0} {$i < 10} {incr i 3} {
if {$i > $count} {
set i $count
}
set status [fooGet $foo [expr $i + 3] $value]
if {&value & &mask} {
set a [expr ($b + $c) * \
($d + $e)]
set status [fooList $foo $a $b $c \
$d $e]
if {($a == $b) && \
($c == $d)} {
...
}
while { condition }{
statements
}
foreach i $elem {
statements
}
if { condition } {
statements
} else {
statements
}
if { condition } {
statements
} elseif { condition } {
statements
} else {
statements
}
switch [flags] value {
a {
statements
}
b {
statements
}
default {
statements
}
}
switch [flags] value {
a {set x $aVar}
b {set x $bVar}
c {set x $cVar}
}
# This is the correct format for a single-line comment set foo 0
# This is the CORRECT format for a multiline comment # in a section of code. set foo 0 # This is the INCORRECT format for a multiline comment \ in a section of code. set foo 0
set day night ;# This is a global variable