Sender of send in time

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Sender of send in time

Clarence Martin via use-livecode
Hi all.

I have a sticky problem here, or I should say a slippery one. Something in my scripts is sending a selectionChanged message in time to a specific datagrid when it shouldn't. How do I determine the sender of a send in time message? The pendingMessages and executionContexts are cleared by that time.

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
Nevermind I found it. But it's a good question. I had to search for "send selectionChanged" and breakpoint each statement until I hit on the correct one.

Bob S


> On Jul 12, 2018, at 10:31 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> Hi all.
>
> I have a sticky problem here, or I should say a slippery one. Something in my scripts is sending a selectionChanged message in time to a specific datagrid when it shouldn't. How do I determine the sender of a send in time message? The pendingMessages and executionContexts are cleared by that time.
>
> Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
Hi.

Would the "executionContexts" be of use here?

Craig



--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
Hi Craig.

No, because send in time allows for messages sent prior to complete execution, so whatever send in time is no longer executing.

Bob S


> On Jul 12, 2018, at 10:45 , dunbarxx via use-livecode <[hidden email]> wrote:
>
> Hi.
>
> Would the "executionContexts" be of use here?
>
> Craig


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode
Bob Sneidar wrote:

 > I have a sticky problem here, or I should say a slippery one.
 > Something in my scripts is sending a selectionChanged message in time
 > to a specific datagrid when it shouldn't. How do I determine the
 > sender of a send in time message? The pendingMessages and
 > executionContexts are cleared by that time.

I don't believe the LC engine maintains awareness of the sender of
timers.  If it does, I don't know of a way that's exposed to scripters.

Where timers are used sparingly, it may be practical as a workaround to
search for those instances and add a param to sent messages to track that.

Alternatively, when using "send...in <time>" then "the result" will
contain the ID of the newly created timer.  You could use that as the
key in an array which stores any info you need about the caller, being
mindful of course to clear entries as they fire so the array doesn't
grow beyond reasonable bounds.

May also be useful to submit an enhancement request for that info,
though I have no suggestions as to how this should be handled, except
perhaps by adding a new item to the pendingMessages entry which would
contain the long id of the sender, if that's sufficient.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
I wonder if the target would return the sender or the sender. I'll check it out.

Bob S


> On Jul 12, 2018, at 11:57 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> Bob Sneidar wrote:
>
> > I have a sticky problem here, or I should say a slippery one.
> > Something in my scripts is sending a selectionChanged message in time
> > to a specific datagrid when it shouldn't. How do I determine the
> > sender of a send in time message? The pendingMessages and
> > executionContexts are cleared by that time.
>
> I don't believe the LC engine maintains awareness of the sender of timers.  If it does, I don't know of a way that's exposed to scripters.
>
> Where timers are used sparingly, it may be practical as a workaround to search for those instances and add a param to sent messages to track that.
>
> Alternatively, when using "send...in <time>" then "the result" will contain the ID of the newly created timer.  You could use that as the key in an array which stores any info you need about the caller, being mindful of course to clear entries as they fire so the array doesn't grow beyond reasonable bounds.
>
> May also be useful to submit an enhancement request for that info, though I have no suggestions as to how this should be handled, except perhaps by adding a new item to the pendingMessages entry which would contain the long id of the sender, if that's sufficient.
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
Unfortunately it's the sendee. The object receiving the message.

Bob S


> On Jul 12, 2018, at 12:59 , Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> I wonder if the target would return the sender or the sender. I'll check it out.
>
> Bob S
>
>
>> On Jul 12, 2018, at 11:57 , Richard Gaskin via use-livecode <[hidden email]> wrote:
>>
>> Bob Sneidar wrote:
>>
>>> I have a sticky problem here, or I should say a slippery one.
>>> Something in my scripts is sending a selectionChanged message in time
>>> to a specific datagrid when it shouldn't. How do I determine the
>>> sender of a send in time message? The pendingMessages and
>>> executionContexts are cleared by that time.
>>
>> I don't believe the LC engine maintains awareness of the sender of timers.  If it does, I don't know of a way that's exposed to scripters.
>>
>> Where timers are used sparingly, it may be practical as a workaround to search for those instances and add a param to sent messages to track that.
>>
>> Alternatively, when using "send...in <time>" then "the result" will contain the ID of the newly created timer.  You could use that as the key in an array which stores any info you need about the caller, being mindful of course to clear entries as they fire so the array doesn't grow beyond reasonable bounds.
>>
>> May also be useful to submit an enhancement request for that info, though I have no suggestions as to how this should be handled, except perhaps by adding a new item to the pendingMessages entry which would contain the long id of the sender, if that's sufficient.
>>
>> --
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode
In reply to this post by Clarence Martin via use-livecode
> Bob S. wrote:
> Something in my scripts is sending a selectionChanged message in
> time to a specific datagrid when it shouldn't. How do I determine
> the sender of a send in time message?

Simply use a a parameter:

send "selectionChanged <yourParam>" to <target> in <time>

where <yourParam> identifies the sender.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Sender of send in time

Clarence Martin via use-livecode


> On Jul 13, 2018, at 1:26 AM, hh via use-livecode <[hidden email]> wrote:
>
>> Bob S. wrote:
>> Something in my scripts is sending a selectionChanged message in
>> time to a specific datagrid when it shouldn't. How do I determine
>> the sender of a send in time message?
>
> Simply use a a parameter:
>
> send "selectionChanged <yourParam>" to <target> in <time>
>
> where <yourParam> identifies the sender.
>

Or, if you don’t want to create such parameters to identify your senders, you could use the executionContexts:

    send "selectionChanged item 2 of line -1 of the executionContexts" to <target> in <time>

Or, if you want to reduce clutter in your many senders, you could just:

    send "selectionChanged the executionContexts" to <target> in <time>

— Dick


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