send ___ to me in ___ sec

J. Landman Gay jacque at hyperactivesw.com
Wed Apr 24 00:32:00 EDT 2002


Dar Scott <dsc at swcp.com> wrote:

 > Look at pending messages, find the
 > message with the latest time (item 2) and then send right after
 > that one.  If the list is empty send ... in 0.
...
  > However, not all queued messages show up there.

I think there may still be some confusion about this. Pending messages
contain only those messages that you decide your scripts should insert,
which you do by using the "send...in <time>" command. No native Rev
commands or events are ever placed in the pending messages queue. That
queue is yours and yours alone. The Rev engine has its own private queue
behind the scenes, which your scripts can't touch.

There is no need ever to "send in 0". Simply issue the command. These
two lines are equivalent:

    send "myHandler" to me in 0
    myHandler

Adding the "send" syntax just makes scripts harder to read and
complicates the pending messages queue. Unless there is a reason you
want to track that particular "myHandler" instance in the queue (can't
think of a reason why you'd need to though,) there is no reason to
specifically "send" it. This is valid, and normal, syntax:

    on mouseUp
      myHandler
    end mouseUp

(But maybe you know that and I missed something.)

Rev sends messages in the same order as events happen. Most events
generate specific  and predictable message sequences -- for example,
clicking a button generates:

   mousedown
   mousestilldown -- a few, not sure how many; in HyperCard the minimum is 3
   mouseup -- if the mouse is still in the object, or,
   mouserelease -- if the mouse is not still in the object

Other events generate other predictable sets of messages, always in the
same order.

If you have messages waiting in (your private) pendingMessages queue,
they are sent at the appropriate time and are inserted into the normal
stream of system messages whenever they come due. Your private pending
messages are time-based rather than event-based. They just get stuck
into the stream as needed.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the use-livecode mailing list