canceling a "wait with messages" call...

Jim Ault jimaultwins at
Wed Aug 29 13:49:52 EDT 2007

David gave you an answer that works for downloading,
but there could be other events you want to "wait

Suggestion:  try a custom property
  wait while the cpBusyFlag of this stack is not empty
--since it might trigger when a script local will not
--    seems like a bug to me

Another thought is to do the following to force the
re-evaluation of the flag variable

get lCurrentFileStatus
repeat while it is not empty
   get lCurrentFileStatus
   wait 1 second with messages
end repeat

Hope this helps

Jim Ault
Las Vegas

--- Andre Garzia <andre at> wrote:

> Hello Friends,
> tricky newbie question here. I have a handler which
> is a looper. It will
> loop downloading files from a queue. It uses a line:
>     wait while lCurrentFileStatus is empty with
> messages
> to let the handler block (but not the application)
> till the download is
> complete or blocked. Tricky thing is, if you simply
> unplug the network
> during the FTP file transfer, revolution is giving
> no error, it waits and
> blocks forever until you abort with CMD+. when it
> promptly sends the expect
> "error" message back to the handler. I can't wait
> till the user aborts the
> call, it's not polite, so I've used another handler
> running in parallel with
> this one which is a timeout handler.
> My first option was, if the timeout handler
> triggers, then I set the script
> local variable lCurrentFileStatus to some
> non-empty-but-error value and the
> looper handler would unblock itself and continue
> processing. This didn't
> work, I don't know why, this is the expected
> behaviour. A script local
> variable is used as flag and one handler blocks
> waiting for other handler to
> work with it. It works like a charm if the download
> goes okay, the message
> sent to the callback handler changes this script
> local variable and the
> handler unblocks.
> If there's no network and my own timeout handler
> tries to set this variable
> to something, the handler does not unblock, instead
> of debugging libURL or
> Rev Engine or wherever the problem is, I am now
> trying to cancel the blocked
> handler. I though it would appear in the pending
> messages, but it does not.
> So the question is, how do I cancel a blocked
> handler?
> Cheers
> andre
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and
> manage your subscription preferences:

More information about the use-livecode mailing list