[Gambas-user] can i specify a path to my modules or libs please how?
PICCORO McKAY Lenz
mckaygerhard at gmail.com
Fri Jul 6 20:12:58 CEST 2018
i dont see documentation about the Component.Load in the wiki about paths!
if i specify
Component.Load("../../thevendor/mylib:0.0.1")
will search two directoryes up from > $XDG_DATA_HOME/gambas3/lib/
??
2018-04-17 15:46 GMT-04:00 Tobias Boege <taboege at gmail.com>:
> program. The most dynamic you get is using
>
> Component.Load(":<vendor>/<library>:<version>")
>
> For example if you have a library "testlib" with version 0.0 and
> vendor "tboege", there will be a corresponding file
>
> $XDG_DATA_HOME/gambas3/lib/tboege/testlib:0.0.gambas
>
> and you can load it at runtime with:
>
> Component.Load(":tboege/testlib:0.0")
>
> This loads the library into your Gambas process. Note that since the
> compiler didn't know that you will load this library, you can't use
> class names exported by it directly in your main project. Either forward-
> declare them or look it up using Class.Load().
>
> The only requirement to this method is that the library is compiled
> into a .gambas file and installed in the appropriate search directory.
>
> [ There is a comment in the source code that says you can also place
> the libraries inside the project directory without a vendor. Those will
> be found too. This is apparently for backwards compatibility and isn't
> "dynamic" anyway, I think. ]
in that case of "inside the project" will work if i use "../../" ?
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
More information about the User
mailing list