User Extensions/Externals

J. Landman Gay jacque at hyperactivesw.com
Tue May 4 13:15:14 EDT 2010


Paul D. DeRocco wrote:
>> From: J. Landman Gay
>>
>>> If so, then it looks like I could
>>> simplify my code, and just do everything in the "startup" handler.
>> That's what I do. :)
> 
> Okay, now I'm a little puzzled. I removed all the old stuff about creating a
> template stack, adding the externals property to it, and then using it to
> create a dummy stack. I then added the following code to my main stack
> script:
> 
>   on startup
>     if the platform is "Win32" then
>       set the externals of stack "main" to "externals/midi.dll"
>     else
>       set the externals of stack "main" to "externals/midi.bundle"
>     end if
>   end startup
> 
> I can now successfully call my external, both under the IDE and as a
> standalone. However, when I examine the property sheet for my main stack
> under the IDE, the property doesn't exist. If I go into the Message Box and
> type
> 
>   put the externalPackages of stack "main"
> 
> to see what's actually loaded, it lists nothing either. Yet it must be
> there, because it's working. Shouldn't both properties exist?

In the IDE, the startup handler won't run in your stack. Startup is sent 
to Rev's Home stack when Rev starts up, and is never set again. Rev 
scans the externals in its own externals folder and in the user data 
folder and loads everything before the IDE stacks appear. If you ask for 
the externalPackages of Rev's home stack, you'll see what you expect.

Your standalone is loading the external in its own startup handler when 
it launches. In the IDE, your stack won't have any externals set. In the 
standalone, it will.

If you're curious, you could rebuild your test standalone to check its 
externals after it's fully open and report them.

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



More information about the use-livecode mailing list