crashing LiveCode regularly with this innocent-looking script

Ben Rubinstein benr_mc at cogapp.com
Fri May 22 12:57:40 EDT 2015


Hi Tony,

Does it crash if you invoke this function directly, or only when it is called 
in the context of a closeField handler?

Which version of LiveCode do you see this in?

thank you,

Ben

On 22/05/2015 17:44, Tony Vazquez wrote:
> I’m playing a little with error messages, or trying to, but I’m crashing LiveCode instead. A closeField message sends us to this function when something other than an integer was entered into it:
>
> function testYears
>     put "" into it
>     repeat until it is an integer
>        if it is an integer then exit repeat else ask "What year shall we use here?" with "1789"
>        if it is an integer then exit repeat else ask "This needs to be a year." with  “1492"
>        if it is an integer then exit repeat else ask "Numbers only; even a negative number for years BCE." with "-33"
>        if it is an integer then exit repeat else ask "Only a year will work here." with "1969"
>        if it is an integer then exit repeat else ask "Are you even trying? Any integer, please." with "1066"
>     end repeat
>     return it
> end testYears
>
> When this function is invoked (by typing a letter into that field), I get as far as seeing that first “ask” dialog box. If I type another letter there as a response, LiveCode either freezes without recovery, or opens the script and then crashes.
> The stack if fully functional except for this error-handling. What’s so toxic here? I don’t see it.





More information about the use-livecode mailing list