finally keyword changed since 1.5 ?

Klaus Major klaus at major-k.de
Wed May 12 09:53:59 EDT 2004


Dag Jan,

> Hi,
>
> When we have next btn script (we have *NO* field "XYZT"), as an 
> example:
> **********
> on mouseUp
>   try
>     put 5 into field "XYZT"
>   catch lMess
>     StopWithMessage "put : Cannot find field "
>   finally
>     answer "Finally"
>   end try
>   exit to top
> end mouseUp
>
> on StopWithMessage pMess
>   answer error pMess
>   exit to top

this line will exit ANY handler immediately!
So there is no "finally" processed... ;-)


 From the docs:

exit to top

Halts the current handler and all pending handlers.
Use the exit to top control structure to stop executing the current 
handler and
suppress pending messages.

> end StopWithMessage
> ***********
> ...
> OK, we can :
> - put all commands in the finally section into the catch section too, 
> or,
> - remove the exit to top from the StopWithMessage handler, or
> - ....
> but this shouldn't be done following the doc's.
>
> Is this a bug (Tuviah, Scott) ?

Although i am not Tuviah or Scott, i don't think this is a bug ;-)

Hope that helps...

> Or *was* it a bug in 1.5 ?
>
> Regards,
> Jan

Regards

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the use-livecode mailing list