Unless

From Sputnik Wiki
Revision as of 09:54, 8 November 2011 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Unless...ElseIf...Else...EndIf

Description

Conditionally run statements.

Unless <expression> Then
    statements
    ...
[ElseIf expression-n Then
    [elseif statements ... ]]
    ...
[Else
    [else statements]
    ...
EndIf

Parameters

expression

If the expression is false, the first statement block is executed. If not, the first true ElseIf block is executed. Otherwise, the "Else" block is executed.

Remarks

Unless statements may be nested.

An Unless is bascially just a negative IF therefor anything that would be TRUE for an If will be FALSE for an Unless.

The expression can contain the boolean operators of AND, &&, OR, ||, NOT, ! as well as the logical operators <, <=, >, >=, ==, ==, and <> as needed.

Example

Unless $a == 100 Then
	println( "Value is 100" )
ElseIf $a == 200 Then
	println( "Value is 200" )
Else
	println( "No Match" )
EndIf

Example of using the logical NOT or ! operator:

Unless NOT $a == 100 Then
	println( "Value is 100" )
ElseIf $a == 200 Then
	println( "Value is 200" )
Else
	println( "No Match" )
EndIf
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox