Unless
From Sputnik Wiki
(Difference between revisions)
(→Remarks) |
|||
Line 42: | Line 42: | ||
Its worth noting you can use Else Ifs and Else Unless together with no problem. | Its worth noting you can use Else Ifs and Else Unless together with no problem. | ||
− | The expression can contain the boolean operators of | + | The expression can contain the boolean operators of &&, ||, ! as well as the logical operators <, <=, >, >=, ==, ==, and <> as needed grouped with parentheses as needed. |
=== Example === | === Example === |
Revision as of 20:57, 16 November 2011
Contents |
Unless...Else Unless...Else
Description
Conditionally run statements.
Unless(<expression>) { statements ... } Else If(expression-n) { else if statements ... } Else Unless(expression-n) { else if statements ... } Else { else statements ... }
Parameters
expression
If the expression is false, the first statement block is executed. If not, the first true Else If block is executed or the first false Else Unless block is executed. Otherwise, the "Else" block is executed.
All the Else If, Else Unless and Else blocks are optional.
Remarks
Unless statements may be nested.
Its worth noting you can use Else Ifs and Else Unless together with no problem.
The expression can contain the boolean operators of &&, ||, ! as well as the logical operators <, <=, >, >=, ==, ==, and <> as needed grouped with parentheses as needed.
Example
Unless($a == 100) { println( "Value is NOT 100" ); } Else If($a == 200) { println( "Value is 200" ); } Else Unless($a == 44) { println( "Value is NOT 44" ); } Else { println( "No Match" ); }