Header Ads

Control Statement in TSL


Flow control statements should be indented one tab length for easier
readability.
If / Else
TSL provides an if/else statement for decision-making. The else clause is
optional. The syntax is as follows:
if () {
statement_1;
...
statement_n;
}
else {
statement_1;
...
statement_n;
}
For Loops
For loop syntax is as follows:
for (; , ) {
statement_1;
statement_n;
}
While Loops
While loop syntax is as follows:
while () {
statement_1;
...
statement_n;
}
Do Loops
Do loop is executed at least once. Syntax is as follows:
do {
statement_1;
...
statement_n;
}
while ()
Powered by Blogger.