Conditional structures: Difference between revisions

Add example for SmallBASIC
(Update Ursalang example to include explanation and "else if" example.)
imported>J7M
(Add example for SmallBASIC)
Line 7,376:
(else 'zero))</syntaxhighlight>
 
=={{header|SmallBASIC}}==
 
===if===
 
<syntaxhighlight lang="basic">
IF foo == 1
PRINT "one"
ELSEIF foo == 2
PRINT "two"
ELSE
PRINT "something else"
ENDIF
</syntaxhighlight>
 
===Inline if===
<syntaxhighlight lang="basic">ans = iff(x <= 5, 0, 10)</syntaxhighlight>
 
===select===
<syntaxhighlight lang="basic">
select case x
case 12
print "x is 12"
case 13,14,15
print "x is 13,14,or 15"
case iff(x <= 4, x, x + 1)
print "x <= 4"
case else
print "x is not <=4,12,13,14,15"
end select
</syntaxhighlight>
 
=={{header|Smalltalk}}==
Anonymous user