out of a bloc
break case default switch
Allow multiple connections. The syntax is based on that of the C language with a generalization of the ´case´ that can take:
1) float values:
case 1:
case 1.5:
2) Or even evaluable expressions in brackets:
case(1,2,3):
case("AB"):
Example:
toto(n)
{
switch(n)
{
case 1:
$"UN"break;
case 2:
$"DEUX"break;
default:
$"AUTRE"
}
}
toto(1) produces UN
toto(2) produces DEUX
toto(3) produces AUTRE
Other example:
toto(n)
{
switch(n)
{
case 1:
$"UN"break;
case 1.5:
$"UN.CINQ"break;
case(1,2,3):
$"UN,DEUX,TROIS"break;
case("AB"):
$"\"AB\""break;
default:
$"AUTRE"
}
}
toto(1) produces UN
toto(1.5) produces UN.CINQ
toto((1,2,3)) produces UN,DEUX,TROIS
toto("AB") produces "AB"
toto(3) produces AUTRE