Conditional structures: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 4,268:
<lang Red>>> if 10 > 2 [print "ten is bigger"]
ten is bigger</lang>
===EITHER===
EITHER: If the result is true the first block! will be evaluated.
If false the second block! will be evaluated.
<lang Red>>> either 3 > 2 [print "Three larger"][print "Nope!"]
Three larger</lang>
===CASE===
CASE: The block! following the first true condition is evaluated.
<lang Red>n: 50
case [
Line 4,296 ⟶ 4,298:
none of these</lang>
 
===SWITCH===
<lang Red>switch "india" [
"a" [print "string"]
Anonymous user