Very Very Very Basic Question!!!!!

David Burgun dburgun at dsl.pipex.com
Thu Mar 23 12:27:34 EST 2006


Hi,

> As for the second line, since myData is declared locally what do  
> you want to do with it?  It's scope suggests that nothing is done  
> with it, since it's declared inside the handler and the handler  
> doesn't do anything with it before it exits.

It was just an example, in the real stack I am doing real things with  
the data, see my posts in "	Re: Weirdness Passing Messages"

> Interestingly, if I change the script in the field to this:
>
>    set the text of me to  "XXXXX"

Bingo! Should this work? Is this a bug? I can see (just) that:

put "XXXXX"  into me

may not work, but not the "set the text of me" form?????

I am about to change it (all over the place) to use:

set the text of the long name of me to "XXXXX"

As this *seems* solid.

One more question: Is it better to use "the long id of me" or "the  
long name of me" ???????

Thanks a lot, I really do appreciate you taking the time to look at  
this.

All the Best
Dave

It was just an
On 23 Mar 2006, at 17:12, Richard Gaskin wrote:

> David Burgun wrote:
>> Should the following lines work 100% of the time, regardless of  
>> how  or where the message handler is called?
>> on MessageHandler
>>   local myData
>>   set the text of the long name of me to  "XXXXX"
>>   put the text of the long name of me into myData
>> end MessageHandler
>
> Works here like this:
>
> Stack "A" is a mainstack, and stack "B" is a substack of "A".  "B"  
> has two cards, the second card has a field with the script above in  
> it. Stack "A" has a button with this script:
>
> on mouseUp
>   send "MessageHandler" to fld "x" of cd 2 of stack "b"
> end mouseUp
>
> If I go to cd 1 of stack "B" and then click the button in stack  
> "A", when I go back to cd 2 of stack "B" I get "XXXXX" in the field.
>
> Interestingly, if I change the script in the field to this:
>
>    set the text of me to  "XXXXX"
>
> ...it fails.
>
> I then reverted the script to the form that works, went to card 1  
> of "B", saved "B", then closed it, and then clicked the button in  
> stack "A" again -- opening "B" again and looking at cd 2 showed  
> "XXXXX" in the field.  This may be useful since it confirms that  
> you can trigger messages and alter properties in stacks that aren't  
> officially open, as long as their destroyStack property is false.
>
> So the rule is that as long as you coerce object references derived  
> from "me" to the long ID you'll be fine.  In other cases "me" will  
> work as expected, but for the reasons outlined in my earlier  
> lengthy post not always (thanks, HyperCard team).
>
> As for the second line, since myData is declared locally what do  
> you want to do with it?  It's scope suggests that nothing is done  
> with it, since it's declared inside the handler and the handler  
> doesn't do anything with it before it exits.
>
> --
>  Richard Gaskin
>  Managing Editor, revJournal
>  _______________________________________________________
>  Rev tips, tutorials and more: http://www.revJournal.com
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the Use-livecode mailing list