Where are the objects of a stack after 'start using'?

Graham Samuel livfoss at mac.com
Mon Aug 25 08:21:39 EDT 2008


Thanks Eric

I had just worked out for myself that a set of re-usable substacks was  
the solution to my "component" issue. The only downside is that since  
the material is in a substack, usually I will have to use "send" to  
invoke the handlers in the component, but that's OK really. I will  
still be using script libraries ('start using') but I will not try to  
mix them up with components!

Best

Graham

(Final thought - I don't think the Rev documentation is great on this.  
It does literally say that 'start using' puts the stack's script into  
the message path, but it doesn't really explain what other kind of  
role the stack can play. The answer seems to be "usually none".  
Anyway, on we go...)

On Sun, 24 Aug 2008 23:34:56 +0200, Eric Chatonet <eric.chatonet at sosmartsoftware.com 
 > wrote:
>
> Bonjour Graham,
>
> A library is a collection of handlers put in a stack's script only.
> The purpose of a library is to make some particular code routines
> available (text, menu, etc.).
> Usually, a library is a 'blank' stack with a single card and no  
> control.
> Just the script of the stack is used and made available from any
> other script of any stack (card, controls, etc.) by putting the stack
> 'in use'.
>
> It seems that you need a component and not a library:
> Why don't you create a registering stack you'll make a substack of
> any project when needed?
> In addition, you can add some code at preOpenstack to pick up some
> values from your mainstack (or elsewhere) then parameter your
> registering stack to suit any project.




More information about the use-livecode mailing list