[Scilab-users] Scilab 6 problem with "Prettify"

Claus Futtrup cfuttrup at gmail.com
Fri Sep 8 21:07:52 CEST 2017


Hi Pierre, et al.

I was able to resolve the problem with the Prettify code by changing ' 
to " in the code for default_options.

I have no idea why this should matter. AFAIR Scilab accepts both (just 
not mixed anymore - and there's no mix-up in the code). Just to prevent 
confusion, here's the code change which works for me (at the moment, 
again, we'll see tomorrow if the fix continues to work):

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);
// 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)


Best regards,
Claus

On 07-09-2017 22:20, Pierre Vuillemin wrote:
>
> Hi Claus,
>
> You need to spot where the 'invalid buffer' message comes from. Adding 
> 'pause' statements throughout your script may help you (or is there a 
> debugging step by step tool? I don't know). Or you may want to comment 
> suspicious parts of your code until there is no more error....
>
> Do you read data at some point? I would intuitively suspect such a 
> message to be related to some data input/data reading operation but I 
> may be mistaken.
>
> Besides, I've encountered a similar behaviour where Scilab 6 seems to 
> work during the first run of a script but then something goes wrong 
> and nothing works quite right anymore (like error messages out of the 
> place) until Scilab is restarted. At this point I find this version 
> quite unstable.
>
>
> Pierre
>
>
> Le 07/09/2017 à 21:55, Claus Futtrup a écrit :
>> Hi all
>>
>> The "Invalid buffer." message becomes even weirder. It is not in the 
>> list of error messages:
>> https://help.scilab.org/docs/6.0.0/en_US/error_table.html
>>
>> I guarantee it's not an error message I've made up myself. The entire 
>> script does not contain the word "buffer" (or "buffer.") anywhere.
>>
>> /Claus
>>
>> On 07-09-2017 21:25, Samuel Gougeon wrote:
>>> Hello Claus,
>>> In Scilab, clear is deleterious. As a first hint, i would try 
>>> commenting it before rerunning  the script.
>>> Best regards
>>> Samuel
>>>
>>> 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)
>>>>
>>>> Can anyone spot, what is the problem?
>>>>
>>>> P.S. This part of the code is in a section that is controlled by an 
>>>> if-statement, and even if I make sure the condition is false (so 
>>>> that the Prettify code is not executed), Scilab still spits out 
>>>> this error. It's really weird - and even weirder it doesn't get the 
>>>> error the first time that the code is executed.
>>>>
>>>> P.S. My entire code is ca. 915 lines long + requires input data, so 
>>>> I prefer not to attach it to a post here in the mailing list.
>>>>
>>>> Best regards,
>>>>
>>>> Claus
>>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>
>>
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


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


More information about the users mailing list