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.

<strong>Tornado</strong> 2.0<br />

User’s Guide<br />

Indentation<br />

■<br />

■<br />

■<br />

Indentation levels are every four characters (columns 1, 5, 9, 13, …).<br />

The module and procedure headings and the procedure declarations start in<br />

column one.<br />

The closing brace of a command body is always aligned on the same column<br />

as the command it is related to:<br />

while { condition }{<br />

statements<br />

}<br />

foreach i $elem {<br />

statements<br />

}<br />

■<br />

■<br />

Add one more indentation level after any of the following:<br />

– procedure declarations<br />

– conditionals (see below)<br />

– looping constructs<br />

– switch statements<br />

– switch patterns<br />

The else of a conditional is on the same line as the closing brace of the first<br />

command body. It is followed by the opening brace of the second command<br />

body. Thus the form of the conditional is:<br />

if { condition } {<br />

statements<br />

} else {<br />

statements<br />

}<br />

The form of the conditional statement with an elseif is:<br />

if { condition } {<br />

statements<br />

} elseif { condition } {<br />

statements<br />

} else {<br />

statements<br />

}<br />

■<br />

The general form of the switch statement is:<br />

switch [flags] value {<br />

a {<br />

statements<br />

332

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

Saved successfully!

Ooh no, something went wrong!