[Scilab-users] vectorfind() upgrade [SEP]

Samuel Gougeon sgougeon at free.fr
Thu Aug 17 11:32:38 CEST 2017


Le 17/08/2017 à 11:10, Samuel Gougeon a écrit :
> Hi Hermes,
>
> Le 17/08/2017 à 10:31, Hermes a écrit :
>> Hi Samuel,
>> Good morning, please guide me how to update scilab so I can use the update
>> function: vectorfind.
>>
>> I have writw access to Scilab installation directory
>> Gracias
>
> There are several ways to include it in Scilab. All ways require first 
> to download vectorfind.sci:
>
>   * Go here: https://codereview.scilab.org/#/c/19055/
>   * Click on the vectorfind.sci line
>   * On the right green panel, click on the download icon ending the
>     list of /Patch Set/, at the (not very) top of the panel. Unzip and
>     save the .sci as /vectorfind.sci/ somewhere on your disk.
>
> Then, if you just want to test vectorfind(), you must just do:
>
> --> exec("path/to/vectorfind.sci",-1);
>
> This will redefine it. But anyclear instruction can remove it (and 
> automatically restore the default version).
> You can do that in your personal startup file:
> --> edit SCIHOME/scilab.ini
> --> // Then add the exec(..) instruction, providing an absolute path, 
> and save.
> --> // You will have then the new vectorfind for each forthcoming 
> Scilab session,
> --> // but still proned to erasing with "clear".
> --> // You may also use
>
> --> getd("path/to/vectorfind/dir")
>
> --> // instead of the exec() instruction. See help getd()
>
> If you wish to have it protected against "clear", you must
>

Arrr.., as usual, the proposed way is not enough to actually protect it 
in its own *vectorfindlib* library, because the *vectorfindlib* variable 
should be protected as well, and this is not possible 
<http://mailinglists.scilab.org/Scilab-users-Replacing-predef-with-an-actual-varprot-a-top-5-priority-for-Scilab-6-1-lt-At-last-prote-tt4036564.html#a4036565>.

So, the only protected solution would be to really replace 
vectorfind.sci in its SCI/modules/elementary_functions/macros native 
directory, and recompile the library (been scilab admin):

  * // save the default vectorfind.sci in a tmp dir (renaming as
    vectorfind_.sci is not enough)
    // replace it with the new proposed one
    // Then

    predef clear
    path = SCI+"/modules/elementary_functions/macros";
    genlib("elementary_functionslib", path)      // in Scilab 6
    // genlib("elementary_functionslib", path, %T)  // in Scilab 5

    // Then restart Scilab. It should be OK


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170817/d6e4f05f/attachment.htm>


More information about the users mailing list