What is wrong with this Script logic?

Robert Brenstein rjb at robelko.com
Fri Jan 11 09:47:13 EST 2013


On 11.01.2013 at 17:03 Uhr +0800 Kay C Lan apparently wrote:
>Actually I just went with the simple example from the dictionary:
>
>on closeField
>    if (the text of me is not an integer) then
>       answer "Please enter only whole numbers!" titled "Enter A Number"
>       select the text of me
>    end if
>end closeField
>
>Still, I do not understand why the IDE is behaving the way it is. It
>doesn't seem right to me.
>

I just checked this in 4.6.3 and the script behaves as expected but I 
get into an loop that I get the dialog over and over. When the dialog 
closes, the original stack with the open field gets its focus back 
and the closefield is triggered again. I gather this happens because 
the old closefield handler did not finish running at that point. May 
be using send in time is a solution.

Robert




More information about the use-livecode mailing list