Problem with wait with messages

Ken Ray kray at sonsothunder.com
Mon Jul 9 18:06:32 EDT 2007


On Mon, 9 Jul 2007 21:41:45 +0100, Dave wrote:

> Hi All,
> 
> I have a handler that gets called on a regular basis via the "send 
> xxx in N seconds"  command.
> 
> The handler then does some processing, but but wait for a task to 
> complete, to do the wait I use:
> 
> if TaskNotDone = true then
>    wait 1 second with messages
> end if
> 
> I thought that this would allow other objects in the stack to 
> function, but this is not the case.
> 
> How can I make it so that I can wait for the task to complete but 
> allow the rest of the GUI to work?

I'd recommend the "wait until <condition>" method... So for example, 
suppose you made "TaskDone" a global variable (I'll call it 
"gTaskDone"). You can initially set gTaskDone to false, then execute 
your "send in..." and then immediately after it put:

  wait until gTaskDone is true

Just be careful, because if gTaskDone is never set to true, the script 
won't ever continue and you'll have issues... :-)

HTH,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list