Bob - as you've found out, nested if/then statements tend to break down in
unexpected ways when you mix the short and long forms of the syntax. To be
on the safe side, always opt for the long form when nesting statements -
these always compile correctly.

Terry...


On 2/03/11 11:40 AM, "Bob Sneidar" <b...@twft.com> wrote:

> 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
> else
>     -- 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.
> 
> Bob
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to