On Wed, 11 Aug 1999, Dave Cragg wrote:

> Hi All
> 
> According to the docs, when sending a message to another card using 
> "send", the context of the handler will be where the handler is 
> located. So if a handler on Card A sends a message to Card B, a 
> reference to field 1 in the running handler on Card B will refer to 
> field 1 of Card B.
> 
> But this doesn't seem to be so. I'm having to specifically include 
> the card reference for fields to get such messages to work. In this 
> case the message is sent to a card in the same stack.
> 
> When using a setprop handler to achieve the same result, I had the 
> same context problem.
> 
> Have I misunderstood the docs, or is there something I may have overlooked?

The doc here is a little misleading: the context change only happens
if you send to an object in a different *stack*, not to an object on a
different card in the same stack.  Not sure why this is the way it is,
but I suspect some HyperCard or SuperCard compatibility feature.  If
you want to change the card context, you need to use "go" to go to
that card (lock the screen if you don't want the user to see this
change).

> I know about the general inadvisability of using "send", and I'm 
> generally a good boy which may be why I haven't  seen this problem 
> before. But I have a situation where it is convenient (if not 
> necessary) to do this.

There's no problem using send.  It's not as efficient as calling a
handler in the same object;s script, but as Richard pointed out, the
difference is small.
  Regards,
    Scott

> Any insights welcome.
> 
> Cheers
> Dave Cragg
> _____________________________________________
> The LACS Centre (Business English Training Resources)
> mailto:[EMAIL PROTECTED]
> http://www.lacscentre.co.uk
> _____________________________________________
> 

********************************************************
Scott Raney  [EMAIL PROTECTED]  http://www.metacard.com
MetaCard: You know, there's an easier way to do that...

Reply via email to