crashing LiveCode regularly with this innocent-looking script

Tony Vazquez tony.v at zquez.us
Fri May 22 12:44:50 EDT 2015


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.

This communication can be unlawfully collected and stored by the National 
Security Agency (NSA) in secret. The parties to this email do not 
consent to the retrieving or storing of this communication and any 
related metadata, as well as printing, copying, re-transmitting, 
disseminating, or otherwise using it. If you believe you have received 
this communication in error, please delete it immediately.




More information about the use-livecode mailing list