Finding the main stack

Pete pete at mollysrevenge.com
Fri Jul 8 12:29:37 EDT 2011


I see what you mean about the target, confusion on my part.  And thanks for
the main(), definitely saves on typing.


Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Thu, Jul 7, 2011 at 10:02 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> 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
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>
>



More information about the use-livecode mailing list