Anonymous user
Conditional structures: Difference between revisions
→{{header|Harbour}}
(Added Scala) |
|||
Line 1,535:
=={{header|Harbour}}==
'''if-elseif-else-endif'''
<lang
SomeFunc1()
ELSEIF x == 2
Line 1,544:
'''do case'''
<lang
CASE x == 1
SomeFunc1()
Line 1,555:
'''switch'''
While '''if-elseif-else-endif''' and '''do case''' constructions allows using of any expressions as conditions, the '''switch''' allows literals only in conditional '''case''' statements. The advantage of the '''switch''' command is that it is much faster.
<lang
CASE 1
SomeFunc1()
EXIT
CASE 2
SomeFunc2()
EXIT
OTHERWISE
SomeFunc()
=={{header|Haskell}}==
|