More send in time

Dar Scott dsc at swcp.com
Tue Jul 1 10:52:00 EDT 2003


On Monday, June 30, 2003, at 09:16 PM, Ken Norris wrote:

> I took the basic premise I started from, then sliced off bits and 
> pieces of
> the posted scripts, reassembled them, refactored and hopefully reduced 
> it.

I'm glad you are able to get into this.

I would like to point out to all that Jan's example, Ken's masterpiece, 
and both of Scott's examples have a feature that if left in when one 
tries to generalize the approach can be a problem.  That feature has 
been in some that I have presented, too.

In the up-and-coming real-soon-now totally-free "A Primer on Message 
Mechanics" (formerly send primer) is a checklist for the desired 
starting behavior and a potential multiple cycles.  The key question 
for here is in essence:

      Can multiple calls to the start handler create multiple cycles?
      How about if they are executed quickly in succession?

Well, examples used intervals of 10, 20 and 50 ms, so repeated 
mouseDown while a message is pending is unlikely, but if one increases 
that drastically, or tries to apply this a different way, there can be 
trouble.  Imagine an interval of 800 ms and 
down-up-down-up-dooooooooooooooooooowwwwwwwwwwwn.

The primer starts out with a simple example that does not use the 
message ID as all of these examples.  The primer introduces some 
concepts slowly, so the ID is introduced later.  It solves this problem 
by using a third state in the state variable, on that I intend to be 
natural in the example.

Partially by isolating start and stop handlers and paying attention to 
the state variables, the primer introduces an approach to building 
message machines that are stable and robust, suitable for building into 
complex machinery including that with custom and built-in callbacks.  
Well, that's my goal anyway.  The first half, of course, is primarily 
about send.

I'm hammering some at this every day.

Dar Scott




More information about the use-livecode mailing list