I guess I stumped everyone. :(

xavier.bury at clearstream.com xavier.bury at clearstream.com
Thu Nov 3 08:31:52 EST 2005


Hi Charles,

One common source of errors is with the word "me"

First because if you transfer code from a control to a stack, Me changes.
Me works fine for cards or stacks but you have to be sure of teh context.

For example in a button script

on mouseup
 put me
end mouseup

gives you nothing - unless the button has content. Same with a field.

Second

"if the owner of the target is me"

You need to check if the target exists!!! 

if may not be necessary on a mouseup but on other
handlers, and one that gets sent a message above all,
there's no guarantee there is a target...

cheers
Xavier

use-revolution-bounces at lists.runrev.com wrote on 03/11/2005 14:15:29:

> 
> On Nov 3, 2005, at 1:51 AM, Ken Ray wrote:
> 
> > Basically here's how this works - all the ___stack and ___card 
> > messages
> > (preOpenStack, openCard, etc.) are sent to the card, and then 
> > travel through
> > the hierarchy to the stack. If the stack is a substack, it then 
> > travels to
> 
> For a beginner (someday I'll stop being a beginner), that's where the 
> problem starts. I have this message called preOpenStack, which I can 
> use to set up my stack, and it's handled in the script for the . . . 
> card? Yes, I see why; but it is not intuitive.
> 
> Thanks for your very lucid explanation of "owner" and "target" and 
> "me". It turns out that my problem was this: during development I 
> have an "initialize" button on the one card of my main stack (so as 
> to set up or reset the underlying database), and the button's script 
> says
>       send "preOpenStack" to this stack
> If my preOpenStack handler begins with "if the owner of the target is 
> me" then I get an execution error (because of passing that message 
> into the stratosphere) when I press the "initialize" button; but it 
> works fine when I'm really opening the stack. Alternatively, the line 
> "if the target is me" works with the button, but does nothing if I'm 
> really opening the stack. All that makes sense I think. I can't think 
> how to write that line for both contexts -- suggestions?
> 
> Charles Hartman
> 
> _______________________________________________
> 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



-----------------------------------------
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is 'firstname.familyname at clearstream.com'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

END OF DISCLAIMER



More information about the Use-livecode mailing list