02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

B<br />

Tcl<br />

}<br />

}<br />

b {<br />

statements<br />

}<br />

default {<br />

statements<br />

}<br />

B<br />

If the actions are very short and nearly identical in all cases, an alternate form<br />

of the switch statement is acceptable:<br />

switch [flags] value {<br />

a {set x $aVar}<br />

b {set x $bVar}<br />

c {set x $cVar}<br />

}<br />

■<br />

■<br />

Comments have the same indentation level as the section of code to which they<br />

refer (see Comments, p.333).<br />

Opening body braces ({) have no specific indentation; they follow the<br />

command on the same line.<br />

Comments<br />

■<br />

Place comments within code so that they precede the section of code to which<br />

they refer and have the same level of indentation. Separate such comments<br />

from the code by a single blank line.<br />

– Begin single-line comments with the pound symbol as in the following:<br />

# This is the correct format for a single-line comment<br />

set foo 0<br />

– Multi-line comments have each line beginning with the pound symbol as<br />

in the example below. Do not use a backslash to continue a comment<br />

across lines.<br />

# This is the CORRECT format for a multiline comment<br />

# in a section of code.<br />

set foo 0<br />

# This is the INCORRECT format for a multiline comment \<br />

in a section of code.<br />

set foo 0<br />

333

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!