Page 1 of 1
A Basic Question On Message Path
Posted: Mon Oct 18, 2010 5:53 am
by WaltBrown
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
Re: A Basic Question On Message Path
Posted: Mon Oct 18, 2010 6:15 am
by Dixie
Walt...
The target returns the object which received the message that started execution.
be well
Dixie
Re: A Basic Question On Message Path
Posted: Mon Oct 18, 2010 6:20 am
by WaltBrown
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
Re: A Basic Question On Message Path
Posted: Mon Oct 18, 2010 8:12 am
by FourthWorld
You can query the executionContexts global property to obtain the calling chain.
Re: A Basic Question On Message Path
Posted: Mon Oct 18, 2010 5:49 pm
by WaltBrown
Thanks Richard, I knew I had seen something like that but forgot the vocabulary.
Walt
Re: A Basic Question On Message Path
Posted: Mon Oct 18, 2010 6:11 pm
by FourthWorld
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.
