defaultStack Scope

Scott Rossi scott at
Fri Jul 12 16:50:01 EDT 2002

Recently, "Dan Shafer"  wrote:

>> Doesn't work that way on my machine (WinXP). Open Rev -> Create New Stack
>> and name it "foo". Type:
>> put the defaultstack
>> into the messagebox
>> returns:
>> stack "foo"
> OK. Are you starting clean? I'm in a situation where there is a
> mainstack open, along with two substacks. If I have the mainstack
> open and I type
> set the defaultStack to "foo" (not the name, but...)
> into the message box and then immediately type
> put the defaultStack
> I get the name of the mainstack.

I believe defaultStack is a global property that operates locally.  So, if
you type in the message box:

  set the defaultStack to "foo";put the defaultStack

You should get "foo".

In other words, once a handler is done executing, the defaultStack is reset
to the top stack.  Since you typed your test scripts separately in the
message box. The defaultStack was reset by the time you queried it.


Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
E: scott at

More information about the Use-livecode mailing list