[Scilab-users] Question on switch

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

[Scilab-users] Question on switch


Dear all,

I've seen that Scilab accepts the conditional switch clause like Matlab and C, and it seems to work as expected. But when one attemps to get help
on switch the result refers to a switch block from Xcos.

Indeed, it is not documented among the control flow keywords.

I wonder if it is or will be deprecated, and if it is advisable not to use it and use select instead (like in Fortran and Basic).

The mfile2sci function converts the switch clauses to select. 

Thank you.

Regards,

Federico Miyara

Libre de virus. www.avast.com

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

Re: Question on switch

Hello Federico,

I have nothing to add to comments posted for the bug 14940  about this topic.

Le 08/03/2019 à 20:46, Federico Miyara a écrit :

Dear all,

I've seen that Scilab accepts the conditional switch clause like Matlab and C, and it seems to work as expected. But when one attemps to get help
on switch the result refers to a switch block from Xcos.

Indeed, it is not documented among the control flow keywords.

I wonder if it is or will be deprecated, and if it is advisable not to use it and use select instead (like in Fortran and Basic).

The mfile2sci function converts the switch clauses to select.

Yes, it's enough.


Thank you.

Regards,

Federico Miyara

Regards
Samuel



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

Re: Question on switch


Dear Samuel,

OK, very clear. I have added some comments there.

Now I'm curious why the "then" keyword has been included in Scilab (but allowed to leave it out).

In my opinion it is an unnecessary addition to the select case construct from other languages such as Fortran.

Regards,

Federico







On 08/03/2019 18:23, Samuel Gougeon wrote:
Hello Federico,

I have nothing to add to comments posted for the bug 14940  about this topic.

Le 08/03/2019 à 20:46, Federico Miyara a écrit :

Dear all,

I've seen that Scilab accepts the conditional switch clause like Matlab and C, and it seems to work as expected. But when one attemps to get help
on switch the result refers to a switch block from Xcos.

Indeed, it is not documented among the control flow keywords.

I wonder if it is or will be deprecated, and if it is advisable not to use it and use select instead (like in Fortran and Basic).

The mfile2sci function converts the switch clauses to select.

Yes, it's enough.


Thank you.

Regards,

Federico Miyara

Regards
Samuel



Libre de virus. www.avg.com


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


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

Re: Question on switch

Le 09/03/2019 à 01:45, Federico Miyara a écrit :
Dear Samuel,

OK, very clear. I have added some comments there.

Now I'm curious why the "then" keyword has been included in Scilab (but allowed to leave it out).

In my opinion it is an unnecessary addition to the select case construct from other languages such as Fortran.

+1


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