examples in tutorial
if a == b then
env.out.print("they are the same")
else
if a > b then
env.out.print("a is bigger")
else
env.out.print("b bigger")
end
end
limited by set pattern in old school
if a == b then
env.out.print("they are the same")
elseif a > b then
env.out.print("a is bigger")
else
env.out.print("b bigger")
end
just use "else ... then" instead of "elseif ... then"
if a == b then
env.out.print("they are the same")
else a > b then
env.out.print("a is bigger")
else
env.out.print("b bigger")
end
And it is ok in expressions
x = 1 + if lots then 100 else afew then 10 else 2 end
And there is almost no additional cost for parsing.
examples in tutorial
limited by set pattern in old school
just use "else ... then" instead of "elseif ... then"
And it is ok in expressions
And there is almost no additional cost for parsing.