nested ifs

Brian Yennie briany at qldlearning.com
Wed Jan 25 23:02:00 EST 2006


Dave, Chipp, et al.

Consider that the following snippet is actually ambiguous. Notice two 
different formatting passes at exactly the same code. Now, of course, 
the first formatting actually resolves to valid code, while the second 
one is one "end if" short -- but who is the compiler to say which one 
you intended?

Well, that's my theory anyway - you can't actually determine which "if" 
matches matches which "else" and  "end if".

1)
If x > y then
     doSomething1
     if a = be then doSomething2 ##problem here
else
     doSomethng3
end if

2)
If x > y then
     doSomething1
     if a = be then doSomething2 ##problem here
     else
         doSomethng3
     end if




More information about the use-livecode mailing list