Setting paths to Externals in revolution

Trevor DeVore lists at mangomultimedia.com
Mon Dec 3 10:16:40 EST 2007


On Dec 3, 2007, at 7:20 AM, paolo mazza wrote:

> I tryed a simpler solution. The following script (ONLY FOR MACOSX)  
> will
> upload all the externals placed in the Externals folder of the bundle
> standalone application.  As far as I know  it works fine . Why I  
> have to
> create a stack "myExternals" ?  Am I going to face some problems using
> this simple script at sturtUp of the application?

Hi Paolo,

As Klaus mentioned using startup is perfectly fine for setting  
externals. I'm providing a few extra specifics about why I use the  
separate stack method in my work to help clarify when it might be  
needed.

I use a separate stack in memory to load externals in my application  
framework. When the framework loads an application in the IDE it  
checks to see what externals Revolution already loaded. It will then  
load any externals that the application relies upon but which are not  
yet available. Since the framework cannot rely on a startup message  
when loading an application inside of the IDE a separate stack of some  
sort must be used.

Some application designs have multiple stack files. In order to make  
external handlers available to all stacks you must put the stack that  
loaded the externals into use (start using stack  
SOME_STACK_WITH_EXTERNALS_SET). Any handlers defined in that stack  
script will also be put into use and be available to all scripts.  
Using a separate stack helps keep the externals isolated. I know that  
loading the externals and putting the stack into use only loads  
external handlers into the message path, nothing else.

Using a separate stack makes it easy to load/unload externals from  
memory. This might be useful if you update the externals on disk and  
don't want to quit and relaunch the IDE or the application.

Using a separate externals stack is more flexible overall. If you need  
that sort of flexibility then it is worthwhile to go that route. If  
you don't then using the startup handler and setting the externals of  
your main program stack is just fine.

-- 
Trevor DeVore
Blue Mango Learning Systems
www.bluemangolearning.com    -    www.screensteps.com





More information about the use-livecode mailing list