Le 07/09/2017 à 23:14, Samuel Gougeon a écrit :
Le 06/09/2017 à 21:33, Claus Futtrup a écrit :
Hi there
I've started to use the prettify functions by Pierre Vuillemin. So
far so good in Scilab 5.5
Now I've started to look into Scilab 6 (not least because graphics is
much faster), but I get a weird error.
If I start Scilab, first time I execute the code, I get an "Invalid
buffer." message.
Second time I execute the code then I get a bad message:
--> exec('C:\Users\claus\Documents\Scilab54\z3mfit.sce', -1)
at line 93 of executed file
C:\Users\claus\Documents\Scilab54\z3mfit.sce
'labels_font_size' , 3,...
^^
Error: syntax error, unexpected "'", expecting "," or )
When I run my script, the first thing my code does - it clears all
variables, all graphics and clears console, so it's not "old" stuff
from previous run that is the problem. Or ???
The "line 93" is part of the default options in Prettify, where it
says labels_font_size. It looks like this:
default_options = struct('title_font_size' , 4,...
'labels_font_size' , 3,...
'thicks_font_size' , 2,...
'num_format' , '',...
'leg_font_size' , 3,...
'line_thickness' , 2,...
'xstring_font_size' , 2)
Weird errors sometimes occur after copying/pasting some code from a
rich text formated document to Scinotes or the console. Some usual
characters like the space or quotes may have some special encoding in
formated text, and keep it in Scinotes, but are not aknowledged by the
parser.
The last time i got this situation, it was about spaces that looked
like spaces, but that were not ascii(32). To avoid this, i pasted the
text in a raw text unformated .txt file before copying/pasting in
Scinotes.
If you have copied/pasted some code directly from the web (like Pierre's
Github page), it could be a source of encoding bugs: Web pages often use
unbreakable spaces ( in HTML). I am pretty sure that Scilab's
parser doesn't like them.
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users