[Scilab-users] {EXT} Re: Functions lib

Dang Ngoc Chan, Christophe Christophe.Dang at sidel.com
Thu Sep 22 09:48:27 CEST 2016


Hello,

> De : Gerhard Kreuzer
> Envoyé : jeudi 22 septembre 2016 09:03
>
>> Von: Samuel GOUGEON
>> Gesendet: Donnerstag, 22. September 2016 08:27
>>
>> You may
>> […]
>> Then for each new Scilab session, the functions of your library with be
>> available from anywhere in the session.

There is also the quick and dirty way :
put it in a *.sci file as mentioned,
and read this file with an exec() or getd()
in the Scilab code.
But the effort for learning how to declare it in an *.ini file
can spare you some effort latter.

You might also look at the "library" section of the help:
https://help.scilab.org/docs/6.0.0/en_US/section_b0e75452c88728d23bbe1cbd7fad7b12.html

I don't know now, but before, you had to create a directory containing:
* a file named "name" (without any extension),
which is an ascii file containing the names of the functions;
* for each function, create a *.bin file with the name of the function
with : save("function_name.bin", function_name);
* call the library with the lib() command.

The advantage compared with the simple *.sci method
Is that you can have several functions with the same name,
e.g. if you defined an f() function in the library lib1 and in the library lib2,
you can call them with lib1.f() and lib2.f().
Not sure that it is worth investing in this knowledge.

Regards

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


More information about the users mailing list