Hello Gerhard,

Great question ! Use the toolbox_skeleton [1] and create you own Scilab toolbox 
to easily re-use you
own function set. It might be automatically loaded at Scilab startup and used 
by your scripts.

First, simply create a directory "myToolbox" and a sub-directory "macros". Put 
all your Scilab
function (aka macros) in this sub-directory.

Second, copy the builder.sce and macros/buildmacros.sce (from the skeleton) 
into your directories to
"build" the library. Change the TOOLBOX_NAME and TOOLBOX_TITLE on builder.sce 
to reflect your
toolbox name ("myToolbox" in this example). Still on builder.sce, remove all 
the non-macros builds
(no C / C++ / help).

Third, copy and rename etc/toolbox_skeleton.start and etc/toolbox_skeleton.quit 
into directory etc/
in your toolbox to "load" the library. In your "myToolbox" example, rename them 
etc/myToolbox.start and etc/myToolbox.quit. Edit the myToolbox.start file to 
only load the Scilab
function (no C / C++ / help / preferences). Still on myToolbox.start, change 
the library name
"toolbox_skeletonlib" to "myToolboxlib".

And that's it ! `exec builder.sce` to build the toolbox and `exec loader.sce` 
to load it. To load it
at Scilab startup, use `atomsInstall` with the directory argument.
[1]: https://wiki.scilab.org/howto/Create%20a%20toolbox

For in depth, understanding browse the wiki or any existing toolbox on ATOMS.



Le mercredi 21 septembre 2016 à 23:08 -0700, Gerhard Kreuzer a écrit :
> Hi,
> I now have some functions and want to use it from different scripts. Copying
> this functions into each script isn't that nice. Any way to have some
> 'function library' which I can put all this common things?
> Thanks for helping
> Gerhard
> --
> View this message in context: 
> http://mailinglists.scilab.org/Functions-lib-tp4034588.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
> Nabble.com.
> _______________________________________________
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
users mailing list

Reply via email to