Conditional structures: Difference between revisions

Content added Content deleted
(implementation AutoIt conditional structures)
No edit summary
Line 3,633: Line 3,633:


'''\''' and '''/''' redirect the flow of control. All the other characters besides $ and # are commentary.
'''\''' and '''/''' redirect the flow of control. All the other characters besides $ and # are commentary.



==[[Sparkling]]==

If statement:

<lang sparkling>var odd = 13;
if odd % 2 != 0 {
print("odd");
}</lang>

If-else statement:

<lang sparkling>var odd = 13;
if odd % 2 != 0 {
print("odd");
} else {
print("even");
}</lang>

If and if-else statements can be chained:

<lang sparkling>var nodiv3 = 13;
if nodiv3 % 3 == 0 {
print("divisible by 3");
} else if nodiv3 % 3 == 1 {
print("gives 1 remainder");
} else {
print("gives 2 remainder");
}</lang>

There's no "switch-case" statement in Sparkling yet, but it's work in progress.


=={{header|SQL}}==
=={{header|SQL}}==