Finding the main stack

J. Landman Gay jacque at hyperactivesw.com
Fri Jul 8 01:02:19 EDT 2011


On 7/7/11 10:44 PM, Pete wrote:
> I'm beginning to think the same thing.  However the dictionary entry for
> "the target" says it resolves to the object that "originally received the
> message" and since the start using command came from the preOpenCard handler
> of a card in the application stack, I took that to mean the card that issued
> the "start using" command.

The target is the object that receives the message, not the one that 
sent it. Your mainstack sent it; the library stack received it.

>
> I can easily get round this by calling the initialise handler from the
> original card immediately after the start using command - I was hoping to
> make things as simple as possible for the people who want to incorporate my
> library into their stacks but I guess one extra line of code is no big deal.
>   The custom property holds a list of databases to be opened by the library.

Some of us just put a function into the mainstack script. I use this all 
the time. I got the idea from Richard Gaskin:

function main
   return the short name of me
end main

Then whenever you want to reference the mainstack, you just use main(). 
It also allows you to avoid structures like this in substacks:

   put the short name of (the mainstack of this stack)

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list