Library workaround wanted (predef bug)

classic Classic list List threaded Threaded
1 message Options
hibr01 hibr01
Reply | Threaded
Open this post in threaded view
|

Library workaround wanted (predef bug)

This post has NOT been accepted by the mailing list yet.
I want to make a bunch of sci-files (macros) _permenently_ available in Scilab from startup on. (Even after a "clear" statement). I use Scilab 5.5.2 on several platforms.

I have some experience with GNU Octave. Function files in a directory could be easily added via the "addpath()" statement in the startup file. And addpath() survives a "clear()" statement.

In Scilab there is something similar called "getd()", which would fit my needs but it get lost after a "clear".

So I looked deeper and find library capability in the help. I did in the "scilab.ini":

  genlib('mylib','/path/to/the/sci-files/'); // create the bin-files from the sci
  mylib=lib('/path/to/the/sci-files/'); // create the library "mylib"
  predef("all"); // make the library persistent to survive "clear"

As I already read in the mailing-list archive there is a bug in Scilab, that the "predef" statement cannot be invoked from scilab.ini (.scilab). I could reproduce the bug with the error message:

  Warning: stack problem..., cleared.

on every platform I use. I also find the bug report (http://bugzilla.scilab.org/show_bug.cgi?id=8634) from 2010.

My question is:

How do you manage this? I cannot believe that everybody creates a toolbox. Is there a workaround?

Thanks.

Hani