35 lines
529 B
Plaintext
35 lines
529 B
Plaintext
-- simple construct
|
|
if logicalCondition then conditionWasTrue()
|
|
else conditionWasFalse()
|
|
|
|
-- multi-line is ok too
|
|
if logicalCondition
|
|
then
|
|
conditionWasTrue()
|
|
else
|
|
conditionWasFalse()
|
|
|
|
-- using block stuctures
|
|
if logicalCondition then do
|
|
conditionWasTrue()
|
|
...
|
|
end
|
|
else do
|
|
conditionWasFalse()
|
|
...
|
|
end
|
|
|
|
-- if/else if...
|
|
if logicalCondition1 then do
|
|
condition1WasTrue()
|
|
...
|
|
end
|
|
else if logicalCondition2 then do
|
|
condition2WasTrue()
|
|
...
|
|
end
|
|
else do
|
|
conditionsWereFalse()
|
|
...
|
|
end
|