problem waiting - spellchecker

Dave Cragg dcragg at lacscentre.co.uk
Thu Sep 1 13:28:17 EDT 2005


On 1 Sep 2005, at 17:20, MisterX wrote:
>
>
> repeat...
>   ...
>   put "wait" into xosdictionary["current"]
>   --put the waitdepth -- always 1
>   --if the waitdepth < 2 then
>     wait until xosdictionary["current"] = "continue" with messages
>   -- else skip... poor idea...
>   --end if
>   ...
> end repeat
> then, any button in the spellchecker GUI will do something like  
> ignore, fix,
> etc... and then
>   ...
>   put "continue" into xosdictionary["current"]
> end mouseup
>
> The reason the wait is in the first place is to wait for the user  
> input (or
> abort). Since it's blocked, the only way this could work (it's in a  
> loop
> that parses each word) would be if i added a double condition with a
> property reset and that gets messy...
>
> This requires major code change (not again, 2 already)...
>
> Why can't this wait statement work each time it is called?
> If it works 2 or 3 times why not 4 or more?
>
> What can affect this?
>
> Im removing now all outside influences for the next test run...
>
> The question remains, why does it lock up?

What do you mean by lock up?

If you mean it's hanging at the "wait" statement, then the first  
thought would be that the condition isn't being met. One way to  
explore this would be to use a function as the condition, and spit  
out some loggable data from within the function. Perhaps something  
like this:

repeat...
   ...
   put "wait" into xosdictionary["current"]
   --put the waitdepth -- always 1
   --if the waitdepth < 2 then
     wait until myCondition() = "continue"  with messages
   -- else skip... poor idea...
   --end if
   ...
end repeat

function myCondition
   put xosdictionary["current"] into tRetVal
   put the milliseconds && ":" && tRetVal into field "log"
   return tRetVal
end myCondition

In this way, you can see whether the condition is being continually  
checked or not, and monitor the value that should be changing. At  
least it should give you an idea of where things are going wrong.

Cheers
Dave




More information about the use-livecode mailing list