Page 1 of 1

Using 3rd Party Libraries

Posted: Sat Jun 12, 2010 10:56 am
by andyt
As a newbie I've been struggling with incorporating 3rd Party libraries in my projects.

After much searching and experimentation it would appear (rightly or wrongly) that I first need to open up the library stack in the Revolution IDE before opening my project stack that references the library stack in the 'stack files' pane of the 'stack object inspector' and makes a simple 'start using' statement in a pre open stack function.

The problem is I appear to get errors (can't find handlers mainly) if I don't open up the library stacks in the IDE (or not launching the library stacks prior to opening up the project stack) and when I come to create the standalones a copy of the library stack appears alongside and seperate to the executable allowing a user to move, delete or, should they own Revolution, tinker with the library and break the application (not ideal!).

What I'm looking for is a simple way to add a library as a substack to my project's main stack. Unfortunately I cannot find such a way except for building my application up and around a library stack (not a great solution especially if I have to add other libraries later but at least everything launches in the IDE successfully and is neatly wrapped up in the executable).

Is there a better way? Could Revolution's project file management be improved?

A tutorial or lesson would be great on this :D .

Re: Using 3rd Party Libraries

Posted: Sat Jun 12, 2010 4:03 pm
by Mark
andyt ,

create or open your mainstack, open the library stack that you want to use, open the property inspector for that library stack and set the mainstack of the library stack to your mainstack.

In the script of card 1 of the mainstack, add the following:

Code: Select all

on preOpenStack
  start using stack "Name of the library"
  -- remainder of your own script
  pass preOpenStack
end preOpenStack
Best regards,

Mark