Conditional structures: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 2,825: | Line 2,825: | ||
''(see: [https://github.com/luna/luna/blob/77b1d974cb07528e9f195dd47e177dd497560da1/stdlib/Std/src/Base.luna#L1047-L1050 Std.JSON])'' |
''(see: [https://github.com/luna/luna/blob/77b1d974cb07528e9f195dd47e177dd497560da1/stdlib/Std/src/Base.luna#L1047-L1050 Std.JSON])'' |
||
=={{header|M2000 Interpreter}}== |
|||
===[IF THEN ELSE.IF ELSE]=== |
|||
<lang M2000 Interpreter> |
|||
Module CheckIt { |
|||
Read a |
|||
If a>1 then { |
|||
Print "Top" |
|||
} else.if a>=-4 then { |
|||
Print "Middle" |
|||
} else { |
|||
Print "Bottom" |
|||
} |
|||
} |
|||
CheckIt 100 |
|||
CheckIt 0 |
|||
CheckIt -100 |
|||
Module CheckIt { |
|||
Read a |
|||
Select Case a |
|||
case >1 |
|||
{ |
|||
Print "Top" |
|||
\\ need block if we have more than one line of code |
|||
} |
|||
case >=-4 |
|||
Print "Middle" |
|||
Else |
|||
Print "Bottom" |
|||
End Select |
|||
} |
|||
CheckIt 100 |
|||
CheckIt 0 |
|||
CheckIt -100 |
|||
</lang> |
|||
=={{header|Make}}== |
=={{header|Make}}== |