select keyword
select variable case value1 then instructions 1 case value2 then instructions 2 ... case valuen then instructions n [else instructions] end
variable which value to be analyzed.
values of variable
for which there are appropriate instruction blocks instructions 1, ..., instructions n
.
block of valid instructions.
Notes:
The only constraint is that each then
keyword must be on
the same line as corresponding case
keyword (or use a
continuation mark, see dot).
The keyword "then"
can be replaced by a carriage return or a comma.
instructions1
are executed if expr1=expr
, etc.
According to the Code Conventions for the Scilab Programming Language it is recommended:
Start each statement on a new line.
Write no more than one simple statement per line.
Break compound statements over multiple lines.
For example, use:
rather than
![]() | Warning: the number of characters used to define the body of any
conditional instruction (if while for or select/case) must be limited to
16k. |
Version | Description |
6.0.0 | select is now protected:
Assignments like select=1 are no longer possible. |