A Basic Question On Message Path

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
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

A Basic Question On Message Path

Post by WaltBrown » Mon Oct 18, 2010 5:53 am

I probably just haven't used the right search term in the Dictionary, but how does a library stack know which stack triggered it's libraryStack handler, or will that information only become available when the stack calls one of the library functions directly?

Thanks, Walt
Walt Brown
Omnis traductor traditor

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: A Basic Question On Message Path

Post by Dixie » Mon Oct 18, 2010 6:15 am

Walt...

The target returns the object which received the message that started execution.

be well

Dixie

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: A Basic Question On Message Path

Post by WaltBrown » Mon Oct 18, 2010 6:20 am

Thanks Dixie. In this case, a system "libraryStack" message, "the target" returns the library stack name, not the stack that started using the library.
Walt
Walt Brown
Omnis traductor traditor

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A Basic Question On Message Path

Post by FourthWorld » Mon Oct 18, 2010 8:12 am

You can query the executionContexts global property to obtain the calling chain.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: A Basic Question On Message Path

Post by WaltBrown » Mon Oct 18, 2010 5:49 pm

Thanks Richard, I knew I had seen something like that but forgot the vocabulary.
Walt
Walt Brown
Omnis traductor traditor

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A Basic Question On Message Path

Post by FourthWorld » Mon Oct 18, 2010 6:11 pm

Glad to help, Walt, though I should note that the executionContexts is not documented because it's considered "subject to change". So if you use it, there's a chance it may change or go away in a future version.

That said, it's been in the engine for as long as I've been working with it (since '97), and thus far the only change has been a well-thought-out enhancement to cover behaviors when they were added in v3.5.

So while it's "subject to change", for right now it works darn well, and many projects in the community, including the Rev IDE, make extensive use of it.

There. You've been warned. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply