A curious case

Bob Sneidar bobs at twft.com
Tue Mar 1 19:40:37 EST 2011

Hi all. 

I just came across a curious issue where I had an if then else control structure inside another if then structure. 

I *thought* I used toe be able to use the form

if statement then
    -- do somestuff
else if anotherstatement then
    -- do someotherstuff
    -- do defaultstuff
end if

When I nested this inside another if then else control structure it told me I was missing an end if! However if I converted the above structure to a switch control structure the script compiled fine. Have I stumbled upon something here? It kind of makes sense to me because the compiler may be having trouble knowing which control structure *else if anotherstatement* belongs to. 

This is not a problem per se, but I am just curious and it may help someone else who encounters it in the future to not spend an hour or two poring over code that is technically correct but won't compile. 


More information about the Use-livecode mailing list