Dispatching Messages to Closed Stacks Which Are Not in Memory
Sannyasin Brahmanathaswami
brahma at hindu.org
Mon May 15 23:47:30 EDT 2017
right, I can see the stack in the project browser after the dispatch call but it is not actually open as a top stack… what doesn't make sense is that
a) there is no dictionary word "open"
b) but if you run
open "gems" in the msg box it opens the stack in the GUI as the top stack
c) If you close the stack and remove from memory but run "dispatch" some handler to that stack
"re-opens" but is not open in the GUI as a top stack…
Yes it's stack script is available for us to talk to;
but it is not "really" open in the way that
open "gems" opens it. OK…
d) I suspect it is open in mode 0
- **Mode 0: closed but loaded**
confirmed: put the mode of stack "gems"
[returns] 0
so "re-open" is misleading.. it is closed but loaded (new concept for me after 30 years of xtalk!)
so what is the optimum option (especially for mobile) to show the stack after loading it?
"Go me" or "toplevel me"
neither work in the handler in the stack "gems") which is in mode 0… "me" seems to continue to refer to the stack issuing the dispatch (stack "journal")
I have to pass an explicit reference to the stack by using it's own name that is loaded but not open…
so our generic "journalResume" handler now looks like this where
this script is in the stack "gems" that is "closed but loaded"
and pEntryA["module"] = "gems"
on journalResume pDataA, pEntryA
answer "Got the Resume Message" with "OK"
go stack pEntryA["module"]
end journalResume
that works… and the logic makes sense.
but seems like we have to work too hard…
would be neater to have a way to dispatch and toplevel at the same time.
i.e. " Executing a dispatch command causes the message to be sent to the
target object with the given argument list." have dispatch also be able to set the mode of the stack it is sending the message to.
BR
On 5/15/17, 8:15 AM, "use-livecode on behalf of J. Landman Gay via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of use-livecode at lists.runrev.com> wrote:
Any reference to a stack will re-open it. The reference here is in the
dispatch command.
More information about the use-livecode
mailing list