External libraries in OS 9 need to start using me!

Alister Pillow alisterhp at mac.com
Thu Oct 7 02:02:13 EDT 2004


Hi,

I've spent about twenty hours trying to understand why my Standalone 
didn't work under OS9. Now that it works, I hope this helps someone 
else.

I have a library stack which is opened by the main stack in the 
preOpenStack handler. This library stack makes calls to the Database 
Library - which is included in the STAB settings.

At long last, I spotted the message from Jan Schenkel
http://lists.runrev.com/pipermail/use-revolution/2004-June/038008.html
which suggests that if your external/library stack needs an external 
(such as the database library)
then you must add the main stack to the stacks in use. (This is not at 
all obvious!)

Specifically, in your main stack:

on preOpenStack
   -- if this _is_ the main stack then...
   if the short name of this stack = "MyMainStack" then
     if the short name of this stack is not among the lines of the 
stacksInUse then
       start using stack (the short name of this stack)
     end if
   end if	

   -- Now add the external library
   if "myExternalLibrary" is not among lines of stacksInUse then
          start using stack "myExternalLibrary"
      end if
   pass preOpenStack  -- don't forget!
end preOpenStack

--
Before I fixed this, the Standalone would throw an error whenever the 
external library code tried to use the revdb library. (But only in OS 
9)

Regards,
Alister


More information about the use-livecode mailing list