Re: Send and the context

2014-02-09 Thread Bob Sneidar
Thanks Jacque. I can see where that may be useful. However, seeing that there seems to be no difference in context between send and dispatch, at least by my experiments, which I admit may have been flawed in some way if others get different results than I did, I can just use dispatch for everyth

Re: Send and the context

2014-02-08 Thread J. Landman Gay
On 2/8/14, 12:34 AM, Bob Sneidar wrote: I DID however find one other difference between send and dispatch: You can send a command but NOT a function! For functions you can use this: get value("myHandler(param)",cd "othercard") where the first parameter is the name of the function with its p

Re: Send and the context

2014-02-08 Thread Bob Sneidar
Thanks Björnke. I decided on a different strategy of putting a function in the card script that gets the values of all the objects I need and returns them as an array. I don’t think being clever with the message path is going to be one of my foundational methodologies in the future. :-) Bob O

Re: Send and the context

2014-02-08 Thread Björnke von Gierke
You might be interested in the "call" command. On 08.02.2014, at 07:34, Bob Sneidar wrote: > This may bore most of you to tears so please disregard if it doesn’t interest > you. > > What I am attempting is to be able to get values from objects on a card that > is not the current card, or eve

Re: Send and the context

2014-02-07 Thread Bob Sneidar
This may bore most of you to tears so please disregard if it doesn’t interest you. What I am attempting is to be able to get values from objects on a card that is not the current card, or even in the current stack, like fields and states of buttons, without enumerating the entire path to the o

Re: Send and the context

2014-02-07 Thread Mark Wieder
Mike Bonner writes: > Curious now though, is there an easy way to get the owning card name of an > object that is sent to without parsing or tree crawling? What do you mean by "without parsing"? put the long id of me into tLongname put word -4 of tLongname into tCardname if word -5 of tLongname

Re: Send and the context

2014-02-07 Thread Mike Bonner
Ah k. I understand what you're saying now. The OP points out that "put the short name of this card" is returning the current card (as per the dictionary, and the behavior in the OP matches this.) If things remain the same and the message is "sent" to the card itself (like it was in the OP) then th

Re: Send and the context

2014-02-07 Thread Mark Wieder
Mike- Friday, February 7, 2014, 7:08:29 AM, you wrote: > Its also probable I should have typed it clearer.. use "of me" instead. > "This" refers to the current card of the default stack. I'm not concerned about your use of "this" or "current". But "me" is the object that generated the send or d

Re: Send and the context

2014-02-07 Thread Mike Bonner
Really? From the dictionary *Summary: * Indicates the current stack , or the current cardof the current stack . Since send changes the "current stack" context, then it would be the current card of whichever stack is sent to.. Or is the dictionary wrong or i'm misunderstanding? In fact, the d

Re: Send and the context

2014-02-06 Thread Peter Haworth
Right. I think that's how things work in a behavior. Wasn't there a change in how the context of the send command functions in a recent release? Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin

Re: Send and the context

2014-02-06 Thread Mark Wieder
Mike- Thursday, February 6, 2014, 11:53:52 AM, you wrote: > use "of me" instead. This refers to the current card of the default stack. No. It doesn't. -- -Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.co

Re: Send and the context

2014-02-06 Thread Mike Bonner
use "of me" instead. This refers to the current card of the default stack. So if the handler is running on a card that isn't the front card, you'll get the short name of the card that IS the front. of me references the object that contains the script in question. On Thu, Feb 6, 2014 at 12:09 PM

Re: Send and the context

2014-02-06 Thread Mark Wieder
Scott Rossi writes: > And you can pass arguments using send: and you can do the same with dispatch: > [ button script ] dispatch "answerIt" to this cd with "bob", "debbie", "judy" > [ card script ] > on answerIt arg1, arg2, arg3 >answer arg1 && arg2 && arg3 > end answerIt -- Mark Wiede

Re: Send and the context

2014-02-05 Thread Scott Rossi
One reason is because "send" can be time delayed, while dispatch cannot. And you can pass arguments using send: [ button script ] send "answerIt bob,debbie,judy" to this cd [ card script ] on answerIt arg1, arg2, arg3 answer arg1 && arg2 && arg3 end answerIt Regards, Scott Rossi Creative

Send and the context

2014-02-05 Thread Bob Sneidar
I read from the dictionary: When the send command is used the stack containing the target handler temporarily becomes the defaultStack. All object references in the message are evaluated in the current context i. e. the defaultStack. Therefore references within the message that refer to "this c