I need to know who sent a message

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

I need to know who sent a message

Post by ale870 » Mon Nov 30, 2009 12:49 am

Hello,

in a event I can use "me" to get a reference to the script owner. Is there a keyword to know who raised the message?
For example:

BUTTON_1:

Code: Select all

on mouseUp
  send "go" to button "BUTTON_2"
end mouseUp
BUTTON_2:

Code: Select all

on go
  answer "This message was arised by..." && sender
end go
In this example, "sender" is not a keyword, but please take only the concept. In BUTTON_2, how can I get the name of the message sender (in the example it it BUTTON_1).

Thank you!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: I need to know who sent a message

Post by Janschenkel » Mon Nov 30, 2009 7:14 am

You can get at it via the executionContexts property; but the more important question is: why do you want to know? You can always pass more information to the second handlker in the form of a parameter. Also make sure to read this article by Richard Gaskin on the message path and how this chain of command allows you to better structure your application.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: I need to know who sent a message

Post by ale870 » Mon Nov 30, 2009 9:09 am

Ok, thank you!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Post Reply