Home stack
Jan Schenkel
janschenkel at yahoo.com
Sat Feb 8 08:47:01 EST 2003
--- Jim Hurley <jhurley at infostations.com> wrote:
> [snip]
>
> Eric,
>
> A minor addendum to Jan's suggestion. The following
> ritual works for
> me--employing a suggestion from Jeanne. Put the
> stack that is to
> masquerade as a home stack into the plug-in folder.
> Include in the
> stack script:
>
> on openStack
> insert the script of me into back
> hide stack "MyPlugIn"
> end openStack
>
> After opening the current stack of interest I go to
> the
> Development/Plugins menu and select MyPlugIn. And
> there is the plugin
> acting as background home stack, out of sight and
> (lurking
> dangerously) out of mind. All relatively painless
> and, Jeanne tells
> us, to become more so in 2.0.
>
> I wonder if it would work as well to load the plugin
> before all other
> stacks. Would its scripts then be available to all
> other loaded
> subsequently? I am unclear of exactly what the
> plugin would be in
> back of.
>
> When you say: "insert the script of stack "myStack"
> into back" are
> those scripts then available only to the stack from
> which they were
> inserted, to all open stacks, to all stacks open
> subsequently, to
> attacks from al queda?
>
> Theorem: All answers raise questions.
>
> Jim
>
Hi Jim,
You are right, that is a wonderful side-effect of the
RunRev plug-in architecture. More on that in a later
post.
Now, to answer your question regarding availability:
the scripts inserted into back, sit in between the
stacksInUse and the engine, in a specific order.
So their handlers and functions are available to all
other scripts (except the ones 'behind' them), and
stay that way until you 'remove' the script again.
One possible use of the specific order in which these
scripts are inserted, is for distributing patches :
Suppose you have a standalone with substack 'Foobar',
whose script is inserted into back at startup. then
you have another script, which checks for the
availability of a 'patch' stack, downloads it, and
inserts its script into back.
There it ends up, a bit surprisingly at first,
_before_ the original script in the message path. Of
course this means that the 'patch' gets the messages
first, and can fix the flawed handler, without you
having to redistribute the app or keep substacks in a
separate folder, to have them replaced in whole at
update time.
When you use either fronstScripts or backScripts, it
is very important to keep track of which messages you
trap at which time, and where you insert and remove
the scripts, as things can get messy if you're not
careful, and you can render the environment
inoperable.
Nevertheless, a very welcome addition by the MetaCard
people to the old 'stacksInUse' that was pioneered by
HyperCard.
Hope this helped someone in their scripting efforts,
Jan Schenkel.
=====
"As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
More information about the use-livecode
mailing list