Control Structures
These are examples of control structures. You may also be interested in:

 Conditional structures
 Exceptions
 Flow-control structures
 Loops

Task

List the conditional structures offered by a programming language. See Wikipedia: conditionals for descriptions.

Common conditional structures include if-then-else and switch.

Less common are arithmetic if, ternary operator and Hash-based conditionals.

Arithmetic if allows tight control over computed gotos, which optimizers have a hard time to figure out.



' Boolean Evaluations
'
' > Greater Than
' < Less Than
' >= Greater Than Or Equal To
' <= Less Than Or Equal To
' = Equal to
 
x = 0
 
if x = 0 then print "Zero"
 
' --------------------------
' if/then/else
if x = 0 then
print "Zero"
else
print "Nonzero"
end if
 
' --------------------------
' not
if x then
print "x has a value."
end if
if not(x) then
print "x has no value."
end if
 
' --------------------------
' if .. end if
if x = 0 then
print "Zero"
goto [surprise]
end if
wait
 
if x = 0 then goto [surprise]
print "No surprise."
wait
 
[surprise]
print "Surprise!"
wait
 
' --------------------------
' case numeric
num = 3
 
select case num
case 1
print "one"
 
case 2
print "two"
 
case 3
print "three"
 
case else
print "other number"
 
end select
 
' --------------------------
' case character
var$="blue"
 
select case var$
 
case "red"
print "red"
 
case "green"
print "green"
 
case else
print "color unknown"
 
end select