On 2016-11-16 08:52, Rolf-Werner Eilert wrote:
> Am 14.11.2016 19:56, schrieb gbwi...@openmailbox.org:
>> On 2016-11-14 18:17, u...@gmx.ch wrote:
>>> Dear Gambas users,
>>> 
>>> 
>>> The situation:
>>> - Different gambas-programs,
>>> - all using similar functions
>>> - All those functions are packed in modules.
>>> 
>>> The question:
>>> I there a way to load those modules at runtime?
>>> As for example in the FMain.Form_Open, something like:
>>> - "ModuleXY.Load(Path_to_Module)", or
>>> - "ImportModule("Path_to_module","LoadAsModuleName")
>>> 
>>> My hope:
>>> Stopping to struggle with similar but diverging functions in 
>>> different
>>> programs by loading a "Master-Module" at runtime.
>>> 
>>> 
>>> Sorry if there is a simple and stupid answer, I've not found it yet.
>>> 
>>> 
>> In short:
>> I would put the modules in a seperate gambas application and make that 
>> a
>> library, instead of regular application.
>> Next make your applications depend on the library (done in project
>> properties of the applications -> refers to an executable of the
>> library), and they can use the common functions.
>> 
>> More info: http://gambaswiki.org/wiki/doc/library
>> 
>> If you have any questions, just ask.
>> 
>> gbWilly
>> 
>> 
>> 
> 
> What will the Gambas IDE do when a program is packaged (Make
> installation package)? Will it add the library to the package, or will 
> I
> have to take care for it myself?
> 
> Rolf

Hi Rolf,

First, you need to package the Gambas library.
Next, you package the application.

In the packaging wizard (when packaging the application) at the step 
Extra dependencies, you need to add the exectable name and version of 
the library.
The name of the library has to be in lower case (and without the .gambas 
extension).
The library version, is the version you used when packaging the library.

When distributing the application you need to distribute the libary 
package along with it.
When installing the application, the OS installer will check if the 
library is installed, if not it will not install the application.
So, first install the library package, next the application package and 
you should be good.

Have fun,

gbWilly


------------------------------------------------------------------------------
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to