On Thu, 27 Feb 2003 Richard Gaskin <[EMAIL PROTECTED]> wrote:

> Anyone have an efficient way of implementing a Cancel button from within a
> loop?

You can use "wait for messages" to do this: have the "Cancel" button
set a variable or property that you check in the loop to know to
abort.  It's a relatively expensive operation, though, so you may want
to only do it every tenth or hundredth time in a very tight loop.  You
also have to be extremely careful that you don't end up causing a
recursion, e.g. by disabling the button that kicks off the processing
(use the waitDepth() function during your testing to make sure it
never goes above 1).  There may be other things that need to be
disabled because they somehow interact with the processing and may
leave your app in a non-functional state.  This is a very powerful
feature but is also very dangerous and so should be used sparingly and
only when you have the time and motivation to do very robust
engineering and testing.
  Regards,
    Scott

> -- 
> Richard Gaskin
> Fourth World Media Corporation
> Developer of WebMerge 2.2: Publish any database on any site
> ___________________________________________________________
> [EMAIL PROTECTED]       http://www.FourthWorld.com
> Tel: 323-225-3717                       AIM: FourthWorldInc

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to