Saving substacks in stand alones
J. Landman Gay
jacque at hyperactivesw.com
Sat Mar 13 23:31:39 EST 2004
On 3/13/04 2:40 PM, James Spencer wrote:
> What I don't get and hope that some kind soul will tell me is:
>
> a) Considering that the data stack is not a substack of the main stack
> but rather is a completely separate entity in its own file, why does
> the doFileSave message get sent to the main stack? I can surmise that
> the main stack of a stand alone application is always in the message
> chain but that doesn't explain to me why that works even within the
> Revolution Environment where I can have lots of stacks open.
Rev has the ability to insert scripts of any object into either the
front or the back of the hierarchy. If you look at the script on card 1
of the data stack, you'll find an explanation of how the tutorial
overcomes exactly the problem you describe. A preOpenCard handler
inserts the script of the main stack into the back of the hierarchy. As
you figured, in a standalone this script would always be available
automatically, but while working in the IDE an insertion is necessary.
>
> b) How does the "this" work in the line above? Does "this stack" refer
> to the stack from which the message was sent?
It refers to the current default stack, which is often, or even usually,
the one that originated the message. It is possible to change which
stack is the default stack though ("set the defaultstack to...") at
which point "this stack" means, um, that one.
How nice to see you on the list, Jim.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list