[Scilab-users] Incorrect color in function

classic Classic list List threaded Threaded
9 messages Options
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Incorrect color in function


Dear all,

When writing the following script in SciNotes (v. 6.1):

function y = testcolor(t)
     if 1==1
         y = sinc(t)
         plot(t, y)
         legend("sinc")
     else
         y = 1
     end
endfunction

the end of the if structure appears with the same brownish color as the
endfunction. Strangely, if copying and pasting here or into a word
processor document, the color is the expected purple (that's why I
removed all colors in this message).

It seems that the culprit is the legend clause.

Regards,

Federico Miyara

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? Incorrect color in function

Hello,

It seems that you're missing a "then" but nonetheless, the problem is really related to legend(), wich is weird.
I can reproduce your color bug with

function a()
    if %t then
        plot()
    else
        legend()
    end
endfunction


but not with

function a()
    if %t then
        plot()
    else
        legen()
    end
endfunction

 (only difference legend()->legen()).

Antoine
 
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
 

>
> Dear all,
>
> When writing the following script in SciNotes (v. 6.1):
>
> function y = testcolor(t)
>      if 1==1
>          y = sinc(t)
>          plot(t, y)
>          legend("sinc")
>      else
>          y = 1
>      end
> endfunction
>
> the end of the if structure appears with the same brownish color as the
> endfunction. Strangely, if copying and pasting here or into a word
> processor document, the color is the expected purple (that's why I
> removed all colors in this message).
>
> It seems that the culprit is the legend clause.
>
> Regards,
>
> Federico Miyara
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? Incorrect color in function

In reply to this post by fmiyara
OK, I think I nailed it:

function a()
    if % then
        end()
    end
endfunction

It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found "if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"

Antoine
 
 
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
 

>
> Dear all,
>
> When writing the following script in SciNotes (v. 6.1):
>
> function y = testcolor(t)
>      if 1==1
>          y = sinc(t)
>          plot(t, y)
>          legend("sinc")
>      else
>          y = 1
>      end
> endfunction
>
> the end of the if structure appears with the same brownish color as the
> endfunction. Strangely, if copying and pasting here or into a word
> processor document, the color is the expected purple (that's why I
> removed all colors in this message).
>
> It seems that the culprit is the legend clause.
>
> Regards,
>
> Federico Miyara
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Claus Futtrup Claus Futtrup
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? Incorrect color in function


HA HA :-D ... it's funny!

Cheers,
Claus

On 10.04.2020 16:09, Antoine Monmayrant wrote:

> OK, I think I nailed it:
>
> function a()
>      if % then
>          end()
>      end
> endfunction
>
> It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found "if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"
>
> Antoine
>  
>  
> Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
>  
>> Dear all,
>>
>> When writing the following script in SciNotes (v. 6.1):
>>
>> function y = testcolor(t)
>>       if 1==1
>>           y = sinc(t)
>>           plot(t, y)
>>           legend("sinc")
>>       else
>>           y = 1
>>       end
>> endfunction
>>
>> the end of the if structure appears with the same brownish color as the
>> endfunction. Strangely, if copying and pasting here or into a word
>> processor document, the color is the expected purple (that's why I
>> removed all colors in this message).
>>
>> It seems that the culprit is the legend clause.
>>
>> Regards,
>>
>> Federico Miyara
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Antoine Monmayrant-2 Antoine Monmayrant-2
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? ?==?utf-8?q? ?= Incorrect color in functio

Yes, quite funny if we write it that way:

////////////////////////////////
function a()
    if %t then
        what_ever_you_want_that_ends_with_end
    end
endfunction

function b()
    if %t then
        or_that_ends_with_end()
    end
endfunction
////////////////////////////////

Frederico, do you think you could fill a bug report?

Cheers,

Antoine
 
Le Vendredi, Avril 10, 2020 16:17 CEST, Claus Futtrup <[hidden email]> a écrit:
 

>
> HA HA :-D ... it's funny!
>
> Cheers,
> Claus
>
> On 10.04.2020 16:09, Antoine Monmayrant wrote:
> > OK, I think I nailed it:
> >
> > function a()
> >      if % then
> >          end()
> >      end
> > endfunction
> >
> > It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found "if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"
> >
> > Antoine
> >  
> >  
> > Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
> >  
> >> Dear all,
> >>
> >> When writing the following script in SciNotes (v. 6.1):
> >>
> >> function y = testcolor(t)
> >>       if 1==1
> >>           y = sinc(t)
> >>           plot(t, y)
> >>           legend("sinc")
> >>       else
> >>           y = 1
> >>       end
> >> endfunction
> >>
> >> the end of the if structure appears with the same brownish color as the
> >> endfunction. Strangely, if copying and pasting here or into a word
> >> processor document, the color is the expected purple (that's why I
> >> removed all colors in this message).
> >>
> >> It seems that the culprit is the legend clause.
> >>
> >> Regards,
> >>
> >> Federico Miyara
> >>
> >> _______________________________________________
> >> users mailing list
> >> [hidden email]
> >> http://lists.scilab.org/mailman/listinfo/users
> >>
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.scilab.org/mailman/listinfo/users
>
>
>
> --
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: ?= Incorrect color in functio

Hello all,

> Le 10 avr. 2020 à 16:44, Antoine Monmayrant <[hidden email]> a écrit :
>
> Yes, quite funny if we write it that way:
>
> ////////////////////////////////
> function a()
>    if %t then
>        what_ever_you_want_that_ends_with_end
>    end
> endfunction
>
> function b()
>    if %t then
>        or_that_ends_with_end()
>    end
> endfunction
> ////////////////////////////////
>
> Frederico, do you think you could fill a bug report?

Yes !

S.

>
> Cheers,
>
> Antoine
>
> Le Vendredi, Avril 10, 2020 16:17 CEST, Claus Futtrup <[hidden email]> a écrit:
>
>>
>> HA HA :-D ... it's funny!
>>
>> Cheers,
>> Claus
>>
>>> On 10.04.2020 16:09, Antoine Monmayrant wrote:
>>> OK, I think I nailed it:
>>>
>>> function a()
>>>     if % then
>>>         end()
>>>     end
>>> endfunction
>>>
>>> It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found "if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"
>>>
>>> Antoine
>>>
>>>
>>> Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
>>>
>>>> Dear all,
>>>>
>>>> When writing the following script in SciNotes (v. 6.1):
>>>>
>>>> function y = testcolor(t)
>>>>      if 1==1
>>>>          y = sinc(t)
>>>>          plot(t, y)
>>>>          legend("sinc")
>>>>      else
>>>>          y = 1
>>>>      end
>>>> endfunction
>>>>
>>>> the end of the if structure appears with the same brownish color as the
>>>> endfunction. Strangely, if copying and pasting here or into a word
>>>> processor document, the color is the expected purple (that's why I
>>>> removed all colors in this message).
>>>>
>>>> It seems that the culprit is the legend clause.
>>>>
>>>> Regards,
>>>>
>>>> Federico Miyara
>>>>
>>>> _______________________________________________
>>>> users mailing list
>>>> [hidden email]
>>>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
>>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
>>
>>
>>
>> --
>> This email has been checked for viruses by Avast antivirus software.
>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/www.avast.com/antivirus
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
>>
>
> _______________________________________________
> users mailing list
> [hidden email]
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? Incorrect color in function

In reply to this post by Antoine Monmayrant-2

Antoine,

I prefer the syntax without "then", it works, it is supported and the "then" seems redundant, but as you say, it is not related to that.

Thanks,

Federico Miyara

On 10/04/2020 11:03, Antoine Monmayrant wrote:
Hello,

It seems that you're missing a "then" but nonetheless, the problem is really related to legend(), wich is weird.
I can reproduce your color bug with

function a()
    if %t then
        plot()
    else
        legend()
    end
endfunction


but not with 

function a()
    if %t then
        plot()
    else
        legen()
    end
endfunction

 (only difference legend()->legen()).

Antoine
 
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara [hidden email] a écrit: 
 
Dear all,

When writing the following script in SciNotes (v. 6.1):

function y = testcolor(t)
     if 1==1
         y = sinc(t)
         plot(t, y)
         legend("sinc")
     else
         y = 1
     end
endfunction

the end of the if structure appears with the same brownish color as the 
endfunction. Strangely, if copying and pasting here or into a word 
processor document, the color is the expected purple (that's why I 
removed all colors in this message).

It seems that the culprit is the legend clause.

Regards,

Federico Miyara

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users




_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Perrichon Perrichon
Reply | Threaded
Open this post in threaded view
|

Re: ?==?utf-8?q? Incorrect color in function

 

Indeed. Isn’t it, but :::

Coming fron 5.x to 6.x, logical and in 5x is « & » and, like in C « && » in 6x.

So a pass is needed in all hundred of files to provide to clients, phonecontact, documentation, and so on – great, thank you so much ; I think it’s more important than « then » instruction.

 

Regards

 

De : users <[hidden email]> De la part de Federico Miyara
Envoyé : vendredi 10 avril 2020 18:16
À : [hidden email]
Objet : Re: [Scilab-users] ?==?utf-8?q? Incorrect color in function

 


Antoine,

I prefer the syntax without "then", it works, it is supported and the "then" seems redundant, but as you say, it is not related to that.

Thanks,

Federico Miyara

On 10/04/2020 11:03, Antoine Monmayrant wrote:

Hello,
 
It seems that you're missing a "then" but nonetheless, the problem is really related to legend(), wich is weird.
I can reproduce your color bug with
 
function a()
    if %t then
        plot()
    else
        legend()
    end
endfunction
 
 
but not with 
 
function a()
    if %t then
        plot()
    else
        legen()
    end
endfunction
 
 (only difference legend()->legen()).
 
Antoine
 
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara [hidden email] a écrit: 
 
 
Dear all,
 
When writing the following script in SciNotes (v. 6.1):
 
function y = testcolor(t)
     if 1==1
         y = sinc(t)
         plot(t, y)
         legend("sinc")
     else
         y = 1
     end
endfunction
 
the end of the if structure appears with the same brownish color as the 
endfunction. Strangely, if copying and pasting here or into a word 
processor document, the color is the expected purple (that's why I 
removed all colors in this message).
 
It seems that the culprit is the legend clause.
 
Regards,
 
Federico Miyara
 
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
 
 
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
 
 

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fmiyara fmiyara
Reply | Threaded
Open this post in threaded view
|

Re: ?= Incorrect color in functio

In reply to this post by Antoine Monmayrant-2

Antoine,

Yes, I've filed it as

https://bugzilla.scilab.org/show_bug.cgi?id=16405

Regards,

Federico Miyara



On 10/04/2020 11:43, Antoine Monmayrant wrote:

> Yes, quite funny if we write it that way:
>
> ////////////////////////////////
> function a()
>      if %t then
>          what_ever_you_want_that_ends_with_end
>      end
> endfunction
>
> function b()
>      if %t then
>          or_that_ends_with_end()
>      end
> endfunction
> ////////////////////////////////
>
> Frederico, do you think you could fill a bug report?
>
> Cheers,
>
> Antoine
>  
> Le Vendredi, Avril 10, 2020 16:17 CEST, Claus Futtrup <[hidden email]> a écrit:
>  
>> HA HA :-D ... it's funny!
>>
>> Cheers,
>> Claus
>>
>> On 10.04.2020 16:09, Antoine Monmayrant wrote:
>>> OK, I think I nailed it:
>>>
>>> function a()
>>>       if % then
>>>           end()
>>>       end
>>> endfunction
>>>
>>> It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found "if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"
>>>
>>> Antoine
>>>    
>>>    
>>> Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara <[hidden email]> a écrit:
>>>    
>>>> Dear all,
>>>>
>>>> When writing the following script in SciNotes (v. 6.1):
>>>>
>>>> function y = testcolor(t)
>>>>        if 1==1
>>>>            y = sinc(t)
>>>>            plot(t, y)
>>>>            legend("sinc")
>>>>        else
>>>>            y = 1
>>>>        end
>>>> endfunction
>>>>
>>>> the end of the if structure appears with the same brownish color as the
>>>> endfunction. Strangely, if copying and pasting here or into a word
>>>> processor document, the color is the expected purple (that's why I
>>>> removed all colors in this message).
>>>>
>>>> It seems that the culprit is the legend clause.
>>>>
>>>> Regards,
>>>>
>>>> Federico Miyara
>>>>
>>>> _______________________________________________
>>>> users mailing list
>>>> [hidden email]
>>>> http://lists.scilab.org/mailman/listinfo/users
>>>>
>>> _______________________________________________
>>> users mailing list
>>> [hidden email]
>>> http://lists.scilab.org/mailman/listinfo/users
>>
>>
>> --
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>>
>> _______________________________________________
>> users mailing list
>> [hidden email]
>> http://lists.scilab.org/mailman/listinfo/users
>>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
>
>

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users