Finally found one.

dunbarx at aol.com dunbarx at aol.com
Tue Oct 2 09:47:56 EDT 2012


Mark.


I thought of that, but believed that the "send in time", where I even increased the time value to, say, 100 ticks, would be more than enough to allow the engine to "rest".



So I am misunderstanding the two paths. I see clearly what "wait with messages" does. But I am trying to avoid "wait" in general. This from an old HC user.


But I thought that "send in time" also placed control back in the hands of the engine (the message pending) for the specified interval. What else is going on during that time? There is no loop. The handler ends, the message is queued, and I would have thought that I can invoke a new instance of that handler from another source, like clicking a button.



This was derived from a post I made on the forum. I tried something like this, and failed, eventually setting a custom property and checking its value to allow the poster to do just what I mentioned.


Thanks,


Craig




-----Original Message-----
From: Mark Wieder <mwieder at ahsoftware.net>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Tue, Oct 2, 2012 1:10 am
Subject: Re: Finally found one.


Craig-

Monday, October 1, 2012, 7:25:49 PM, you wrote:

[bunch of stuff deleted]

> Try it. If you press the "start" button, you get random numbers
> in msg for eight seconds. If you press the "stop" not while this is
> going on, nothing happens.

You need to give the engine some room to breathe. Insert the line

wait 0 milliseconds with messages

at the start of your showRandoms function. The "with messages" part
will allow the engine a chance to look around and see if any events
have occurred (as for instance someone pressing the Stop button).
Otherwise you've coded up a loop that's so tight the engine will never
see the mouseUp (or any other) message.

When you're running this in the debugger there are a lot of engine
events happening - your actual code is only a small fraction of that,
and the engine is paying attention to everything in the environment.
That's why your mouseclicks get registered.

-- 
-Mark Wieder
 mwieder at ahsoftware.net


_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 

 



More information about the use-livecode mailing list