When me is not me

Ali Lloyd ali.lloyd at livecode.com
Sat Mar 10 13:16:41 CET 2018


In theory that shouldn't be the problem - `the <property> of me` should
short-circuit to directly evaluating the property of the object with the
behavior, rather than evaluating `me` as a name first. This is why `put the
long id of me into tID` also works.

Peter, in your original script are you doing
 set the hilitedButton of me to tNum
directly, or
local tMe
put me into tMe
set the hilitedButton of tMe to tNum
?

The latter will have the 'not on the current card' problem, whereas the
former should (in theory) not.

On Sat, Mar 10, 2018 at 2:41 AM Brian Milby via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I think I know what is going on.  If you add a couple of put statements to
> that script you will find that "me" by itself doesn't include the card or
> stack.  So "put me" would give something like [group "Language Choice"]
> which isn't specific enough from another card.  This works:
>
> local tID
> put the long id of me into tID
> set the hilitedButton of tID to tNum
>
> But it can be simpler:
>
> set the hilitedButton of the long id of me to tNum
>
> I didn't do it from an openStack script, but from the message box while on
> another card.
>
> Thanks,
> Brian
>
> On Fri, Mar 9, 2018 at 8:10 PM Peter Bogdanoff via use-livecode <
> use-livecode at lists.runrev.com> wrote:
>
> > Yes, it works great if you are on the card, not if you are somewhere
> else.
> >
> >
> > > On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <
> > use-livecode at lists.runrev.com> wrote:
> > >
> > > Nevermind. Another card. DOH
> > >
> > > On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <bonnmike at gmail.com>
> wrote:
> > >
> > >> What version?  Its working for me in 9 dp11 by using either dispatch
> or
> > >> send to the group.
> > >>
> > >> In the group:
> > >> command doit pbtn
> > >>   set the hilitedbutton of me to pbtn
> > >> end doit
> > >>
> > >> And from the message box..
> > >>
> > >> send ("doit" && 2) to group 1
> > >> or
> > >> dispatch "doit" to group 1 with 3
> > >>
> > >>
> > >> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
> > >> use-livecode at lists.runrev.com> wrote:
> > >>
> > >>> I learned something today.
> > >>>
> > >>> I was trying by script to set the hilite of a radio button in a group
> > on
> > >>> another card.
> > >>>
> > >>> My script is in the group “Language Choice” which is called by
> > openStack.
> > >>> I’m thinking that “me” would operate on the group:
> > >>>
> > >>>        set the hilitedButton of me to tNum
> > >>>
> > >>> Didn’t work, even though the script received the message and
> completed.
> > >>> The radio buttons were unchanged. I modified it to this, which
> worked:
> > >>>
> > >>>        set the hilitedButton of group "Language Choice" of card
> > >>> "Settings" to tNum
> > >>>
> > >>>
> > >>> I can only think that, a group, even though it is on a single card
> and
> > >>> does not have its backgroundBehavior set to true, must be referred to
> > >>> explicitly by the name of the group and the name of the card is
> > resides in.
> > >>> Or maybe it’s because the individual buttons didn't have sharedHilite
> > set
> > >>> to true.
> > >>>
> > >>> Peter Bogdanoff
> > >>> ArtsInteractive
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> 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
> > >>
> > >>
> > >>
> > > _______________________________________________
> > > 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
> >
> >
> > _______________________________________________
> > 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
> _______________________________________________
> 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