Skip to content

select/case: It would be nice that Scilab supports grouped cases

Reported by Samuel GOUGEON (@sgougeon)

Bug description

select/case: It would be nice that Scilab supports grouped cases in the select/case control feature:
select object
 case value0 then ...
 case list(value1, value2,...) then
 ...
end

if / elseif / elseif /... else / end is always available as a slightly heavier workaround

Scilab error message

None. Restricted behavior:

--> a = 3;
--> b = 0;
--> select a
  > case 1, b = 1;
  > case list(2, 3), b = 2.3;
  > case 2, b = 2;
  > end

--> b
 b  = 
   0.

How to reproduce the bug

a = 3;
b = 0;
select a
case 1, b = 1;
case list(2, 3), b = 2.3;
case 2, b = 2;
end
b
Edited by Samuel GOUGEON