Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / Scilab / February 2008



Tip: Looking for answers? Try searching our database.

Load help files at startup

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Markus - 16 Feb 2008 11:30 GMT
Hi,
I have made a toolbox and added lines like this;

SCI_CS = 'U:\SciLab\'
load(SCI_CS+'cs_signal\macros\lib')

...in my scilab.star file. It seems like the functions are loaded into
scilab at startup. But it doesn't seems like the help files are loaded
automatically. Do I need to add a new line in my scilab.star file to
load the help chapters I created?

Regards
Markus
Francois Vogel - 16 Feb 2008 17:23 GMT
> But it doesn't seems like the help files are loaded
> automatically. Do I need to add a new line in my scilab.star file to
> load the help chapters I created?

See help add_help_chapter

Francois
Markus - 20 Feb 2008 18:48 GMT
> > But it doesn't seems like the help files are loaded
> > automatically. Do I need to add a new line in my scilab.star file to
[quoted text clipped - 3 lines]
>
> Francois

Hi,
Using add_help_chapter in the scilab.star file does not work. The
function throws an error complaining about variable SCI is not
defined.
How are the help files for the built in libraries loaded? Is that
being hardcoded when compiling the scilab soure code or someting? Each
such library has at least a line in the scilab.star file like e.g. "
load('SCI/macros/sci2for/lib') " but I cannot find anyplace in
the .star file where the corresponding help chapters are loaded, can
I?

Thanks
Markus
Francois Vogel - 20 Feb 2008 18:57 GMT
Markus said on 20/02/2008 19:48:
> Using add_help_chapter in the scilab.star file does not work. The
> function throws an error complaining about variable SCI is not
> defined.

Please provide exact error message, not a vague description.

Launch Scilab and type:
SCI
What's the output?

Francois
Markus - 22 Feb 2008 12:51 GMT
> Markus said on 20/02/2008 19:48:
>
[quoted text clipped - 9 lines]
>
> Francois

Sorry about the vague descriptiuon. Here is the output I get when I
start scilab:

***************************************************
            ___________________________________
                        scilab-4.1.2

                 Copyright (c) 1989-2007
             Consortium Scilab (INRIA, ENPC)
       ___________________________________________

Startup execution:
 loading initial environment
!--error 4
undefined variable : SCI
at line      13 of function pathconvert called by :
line     3 of function add_help_chapter called by :
g', 'U:\scilab\cs_hydraulics\help\')
line    80 of exec file called by :
exec('SCI/scilab.star',-1);;

-->SCI
 !--error 4
undefined variable : SCI
***************************************************

The lines I added to the scilab.star file looks like:
***************************************************
// Load Control Systems scilab functions libraries
===================
SCI_CS = 'U:\SciLab\';
load(SCI_CS+'cs_hydraulics\macros\lib')
// Add help chapters for Control Systems libraries.
add_help_chapter('CS signal processing', 'U:\scilab\cs_hydraulics\help
\');
***************************************************

I hope that make is more clear.

Regards
Markus
Francois Vogel - 22 Feb 2008 21:17 GMT
> Startup execution:
>  loading initial environment
[quoted text clipped - 5 lines]
> line    80 of exec file called by :
> exec('SCI/scilab.star',-1);;

Of course, you took care to add your lines:

> SCI_CS = 'U:\SciLab\';
> load(SCI_CS+'cs_hydraulics\macros\lib')
> // Add help chapters for Control Systems libraries.
> add_help_chapter('CS signal processing', 'U:\scilab\cs_hydraulics\help
> \');

*after* line 77 of scilab.star, which defines SCI, i.e. after the line:
SCI=getenv('SCI')

Can you check that?

Btw, what does SCI=getenv('SCI') spit in the scilab shell after having
launched Scilab without your added lines in scilab.star?

Francois
Markus - 23 Feb 2008 17:18 GMT
Note! I now test on another computer so the path might differ from
previous posts. Although I don't think it matters.

Anyhow, I got it working at last. This is what happened...

If I completely removed the add_help_chapter line from the scilab.star
file then scilab outputs getenv('SCI') as follows.
******************************************
-->getenv('SCI')
ans  =

C:/Program/SCILAB~1.2
******************************************

However, I also tried to move the add_help_chapter line after the the
declaration of SCI but then I got this error instead:
******************************************
Startup execution:
 loading initial environment
!--error 4
undefined variable : MSDOS
at line      18 of function pathconvert called by :
line     3 of function add_help_chapter called by :
add_help_chapter('CS hydraulics', SCI_CS +'cs_hydraulics\help\');
line    83 of exec file called by :
exec('SCI/scilab.star',-1);;
******************************************

But I finally got it working! I ended up with putting my
add_help_chapter line in the scilab.star file where it looks like:
******************************************
//Scilab Help Chapters,
===============================================
global %helps
%helps=initial_help_chapters(LANGUAGE)
clear initial_help_chapters //%helps
// Add help chapters for Control Systems libraries. This and the line
below is added by myself!
add_help_chapter('CS hydraulics', SCI_CS +'cs_hydraulics\help\');
******************************************
(It should be somewhere around line 120 in the original scilab.star
file)

However it seems strange to me why the original lines like e.g.
load('SCI/macros/mtlb/lib'), which goes before the declaration of
SCI=getenv('SCI') works? There exists no directory namned SCI so I
suppose the function load() has to somewhat interpret it. So why
couldn't add_help_chapter do that too?

Secondly, it seems that the function initial_help_chapters()
overwrites everything in the help so that it is no point adding your
own help chapters before that line. Is that right? I tried to write
"help initial_help_chapters" at the scilab prompt but the function
wasn't documented.
Francois Vogel - 24 Feb 2008 16:51 GMT
> However it seems strange to me why the original lines like e.g.
> load('SCI/macros/mtlb/lib'), which goes before the declaration of
> SCI=getenv('SCI') works?

load("SCI/...") passes a string to the load internal instruction
SCI=getenv("SCI") retrieves the environment variable named SCI and puts its
value into a Scilab variable named SCI.

load() does not need to know Scilab variables, it can parse a string and
substitute internally the special character string SCI to its value.

SCI is a shortcut for "the folder where Scilab was installed".

> There exists no directory namned SCI so I
> suppose the function load() has to somewhat interpret it. So why
> couldn't add_help_chapter do that too?

Because it was not supposed to do it.
The user initialisation scripts such as the instructions you add in
scilab.star are not supposed to be added in this file in fact, but rather in
a user initialisation file. See help startup for details.

> Secondly, it seems that the function initial_help_chapters()
> overwrites everything in the help so that it is no point adding your
> own help chapters before that line. Is that right?

It can be, I didn't check. This is indeed no so surprising that function
*initial*_help_chapters resets the help chapters, while *add*_help_chapter
does not, don't you think so?
Again, you're not supposed to fiddle in scilab.star but to have your own
init script.

> I tried to write
> "help initial_help_chapters" at the scilab prompt but the function
> wasn't documented.

IMO this can be considered as a bug, please file a bug report:
http://www.scilab.org/cgi-bin/bugzilla_bug_II/index.cgi

Francois
Markus - 28 Feb 2008 17:50 GMT
Okey, I didn't even know I could have some kind of own ini file! In
fact I think I searched for an *.ini file in the scilos directory but
found nothing. Then I saw the .star mentioned somewhere I thought that
was the scilos equavilent. And I had no idea that startup would have
been the word to serach for in the help. So thanks for the tip!

I don't think it's obivous that the function initial_help_characters
resets the help chapters. It depends on how it works (which I don't
know as a new user to scilab). If e.g. the help chapters of a former
instance of scilab persists after you've closed the program, you
should of course not add the initial help chapter once again when
starting the program next time. However, that still doesn't mean you
have to remove other already existing help chapters. Anyhow, it
doesn't really matters as long as you can read how it works. So now I
will try to file a bug report.

Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.