dunbarx wrote: ↑Fri May 31, 2024 4:02 pm
Code: Select all
if this then
XYZ
else doThis ; doThat
is NOT the same as:
Code: Select all
if this then
XYZ
else
doThis
doThat
end if
I can't test right now, but I'm not sure
Code: Select all
if this then
XYZ
else
doThis; doThat
end if
is different from your second example.
Your first example doesn't have an
end if, and LC permits the form:
Code: Select all
if <condition> then <action>
else <another action>
But any subsequent lines in that form are no longer part of the conditional. For me this is dangerous syntax as while convenient it can lead to errors.
I always err on the side of putting and
end if tag at the end of my conditionals, and avoid the latter syntax to avoid errors...
Theoretically though, if I understood correct how ; works, this would be valid:
Code: Select all
if this then
XYZ
else ; doThis ; doThat ; end if
This should replicate your second conditional...