Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Editing Standard Scilab functions

1 view
Skip to first unread message

jsi...@gmail.com

unread,
Jul 26, 2007, 3:19:05 PM7/26/07
to
I would like to know if it's possible to edit standard scilab
functions. I know it is in some cases, as in, those for which one can
find the .sci file in the Scilab directory. However, I've encountered
a number of functions which either do not work, or don't work the way
I want them to. Examples:

Scilab handles errors by putting up a dialog box. It's annoying and I
want it to stop.

The "string" command is supposed to output the text of a function. It
doesn't. I'd like to fix that if possible.

Anyone know if it's possible to gain access to standard scilab
functions? I imagine many of them would be written in C which is just
fine, as long as I could see/modify them. Thanks

Enrico Segre

unread,
Jul 29, 2007, 10:31:58 AM7/29/07
to
On Jul 26, 9:19 pm, jsil...@gmail.com wrote:
> I would like to know if it's possible to edit standard scilab
> functions. I know it is in some cases, as in, those for which one can
> find the .sci file in the Scilab directory.

those not written in scilab code are written in C or fortran, and
found somewhere in the sources. You can do what you want with them,
provided that you find them and that you comply with the licence
(which essentially, IIRC, just says that you're not authorized to
redistribute modified code for commercial purposes).

> However, I've encountered
> a number of functions which either do not work, or don't work the way
> I want them to. Examples:
>
> Scilab handles errors by putting up a dialog box. It's annoying and I
> want it to stop.

I can't recall of any. Which one?

> The "string" command is supposed to output the text of a function. It
> doesn't. I'd like to fix that if possible.

perhaps http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1370
?

> Anyone know if it's possible to gain access to standard scilab
> functions? I imagine many of them would be written in C which is just
> fine, as long as I could see/modify them.

search the codebase, or better ask specifically, somebody might know
and could help you
through the mess.

hth, Enrico

Rainer von Seggern

unread,
Jul 29, 2007, 12:22:26 PM7/29/07
to
On 29 Jul., 16:31, Enrico Segre <se...@athena.polito.it> wrote:
> On Jul 26, 9:19 pm, jsil...@gmail.com wrote:
>
> > I would like to know if it's possible to edit standard scilab
> > functions. I know it is in some cases, as in, those for which one can
> > find the .sci file in the Scilab directory.
>
> those not written in scilab code are written in C or fortran, and
> found somewhere in the sources. You can do what you want with them,
> provided that you find them and that you comply with the licence
> (which essentially, IIRC, just says that you're not authorized to
> redistribute modified code for commercial purposes).
>
> > However, I've encountered
> > a number of functions which either do not work, or don't work the way
> > I want them to. Examples:
>
> > Scilab handles errors by putting up a dialog box. It's annoying and I
> > want it to stop.
>
> I can't recall of any. Which one?
>
> > The "string" command is supposed to output the text of a function. It
> > doesn't. I'd like to fix that if possible.
>
> perhapshttp://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1370

> ?
>
> > Anyone know if it's possible to gain access to standard scilab
> > functions? I imagine many of them would be written in C which is just
> > fine, as long as I could see/modify them.
>
> search the codebase, or better ask specifically, somebody might know
> and could help you
> through the mess.
>
> hth, Enrico

Hi
In Scilab we have two kinds of functions. The first one e.g. sinh is
of type 'function' , you will see it by calling typeof(sinh).
The source of this functions you can get with the help of the editor
SciPad. (File, Open source of ...). Then you can edit and rename such
functions.
(You never should use the name of a Scilab function for your own one.)
The second kind e.g. exp is of type 'fptr', you will see it by calling
typeof(exp). Such functions are sometimes called 'hard coded', but I
can't find any explanation
of the meaning of 'fptr'. (In fortran 90 as I remember there are
function pointers = fptr ?). The source code of such functions are
hidden for the normal user.
(Also in this case you may also call a own function exp, but please
never do that.)
Rainer

jsi...@gmail.com

unread,
Aug 14, 2007, 12:37:34 PM8/14/07
to

> Scilab handles errors by putting up a dialog box. It's annoying and I
> want it to stop.

> I can't recall of any. Which one?

Any error you can think of. Incorrect argument type, invalid index,
etc. I'm using the windows version, maybe the unix version doesn't do
that. Using advice from Rainer, I have discovered that the "error"
function is of type "fptr", meaning the source isn't easily found.
This function makes a dialog box automatically.

>> The "string" command is supposed to output the text of a function. It
>> doesn't. I'd like to fix that if possible.

>perhaps http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1370
>?
That link explains the existence of the problem, but doesn't provide
for a solution unless one can edit the "string" function, which seems
like it isn't possible unless one goes back to the source code. I
guess that's what I'll do.

The next obvious question is if I've written something in Fortran/C/C+
+, is there an easy way to include it into the scilab library?

Thanks

Matthias Zenker

unread,
Aug 15, 2007, 5:58:50 AM8/15/07
to
On Aug 14, 6:37 pm, jsil...@gmail.com wrote:
> > Scilab handles errors by putting up a dialog box. It's annoying and I
> > want it to stop.
> > I can't recall of any. Which one?
>
> Any error you can think of. Incorrect argument type, invalid index,
> etc. I'm using the windows version, maybe the unix version doesn't do

I have never seen dialog boxes like that, except for scilab scripts
loaded via scipad.
I'm using scilab since version 3.1 under Windows XP.

Matthias

jsi...@gmail.com

unread,
Aug 17, 2007, 5:06:52 PM8/17/07
to
On Aug 15, 5:58 am, Matthias Zenker <matthiaszen...@nurfuerspam.de>
wrote:

You're right, they only happen when running scilab scripts loaded via
scipad. However, that's how I do all of my work. Is there a way to
get rid of them?


Francois Vogel

unread,
Aug 18, 2007, 2:55:03 AM8/18/07
to
>>>> Scilab handles errors by putting up a dialog box. It's annoying and I
>>>> want it to stop.
> they only happen when running scilab scripts loaded via
> scipad. Is there a way to get rid of them?

Not without tampering with the Scipad source code.

But if changing Scipad's source doesn't frighten you, here's one way of
doing it in the Scipad version that comes with Scilab 4.1 (or 4.1.1),
that is Scipad 6.0.fix2:

- Locate proc scilaberror starting line 238 of
SCI/scipadsources/db_debugsession.tcl

- In this proc, suppress or comment the line that starts by
tk_messageBox -title...

- Save the file (overwrite) and start Scilab again. No compiler needed.

Note that you'll then never see an error message box again, not when
runnning your scripts from Scipad, nor when using the Scipad debugger.

If this is not what you want, just tell.

--
Francois Vogel
1-888-MY-ETHER ext. 01907199
<http://www.ether.com/CallButton/Francois-Vogel/6887475.aspx>
<http://www.ether.com>

jsi...@gmail.com

unread,
Aug 20, 2007, 5:20:30 PM8/20/07
to

> - Locate proc scilaberror starting line 238 of
> SCI/scipadsources/db_debugsession.tcl
>
> - In this proc, suppress or comment the line that starts by
> tk_messageBox -title...
>
> - Save the file (overwrite) and start Scilab again. No compiler needed.
>
> Note that you'll then never see an error message box again, not when
> runnning your scripts from Scipad, nor when using the Scipad debugger.
>
> If this is not what you want, just tell.
>

It's not exactly what I want, but it's definitely good enough.
Ideally I could do something with the set command in Scilab so I could
easily control whether or not
the dialog box was created, but this is fine. Thanks.


Francois Vogel

unread,
Aug 21, 2007, 5:31:27 PM8/21/07
to
> easily control whether or not
> the dialog box was created

In the bleeding edge Scipad I have now implemented a new saved
preference setting that can be toggled on and off from the options menu
of Scipad. You have now control on the popping up of the message box
from Scipad.

This is available in Scipad from version 6.127.

jsi...@gmail.com

unread,
Sep 4, 2007, 3:04:59 PM9/4/07
to
On Aug 21, 5:31 pm, Francois Vogel <fsvogelnew5NOS...@free.fr> wrote:
> > easily control whether or not
> > the dialog box was created
>
> In the bleeding edge Scipad I have now implemented a new saved
> preference setting that can be toggled on and off from the options menu
> of Scipad. You have now control on the popping up of the message box
> from Scipad.
>
> This is available in Scipad from version 6.127.
>

Wonderful, I'll keep an eye out for it (I run windows, the latest
version I can find for it is 6.98). Thanks.

Jacob

Enrico Segre

unread,
Sep 4, 2007, 3:30:28 PM9/4/07
to
> Wonderful, I'll keep an eye out for it (I run windows, the latest
> version I can find for it is 6.98). Thanks.

6.129 is out here:
http://www.scilab.org/contrib/displayContribution.php?fileID=1032
enjoy (hopefully), Enrico

0 new messages