nested ifs

Stephen Barncard stephenREVOLUTION at barncard.com
Wed Jan 25 12:35:30 EST 2006


Chipp, I think the compiler doesn't like dangling THEN's in any case, 
and in fact would be much happier with END IF when the statement gets 
long. Using this form always works (and for me easier to read 
anyway...) - it takes up more space though.


IF <condition>
THEN
   -- statements
ELSE
   -- statements
END IF

>I like to do the following:
>
>if tResult is "Error" then
>   answer "Go Ahead anyway" with "Cancel" or "OK"
>   if it is "Cancel" then exit to top
>end if
>
>Most of the time it compiles, but sometimes the single line if 
>statement in the middle throws and error and won't compile, so I'm 
>forced to do:
>
>if tResult is "Error" then
>   answer "Go Ahead anyway" with "Cancel" or "OK"
>   if it is "Cancel" then
>     exit to top
>   end if
>end if
>
>Anyone know why the compiler does this? I can't seem to figure out 
>under what circumstances this seems to happen.
>
>best,
>
>Chipp

-- 
stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -



More information about the use-livecode mailing list