A switch statement in irScript has similar syntax and semantics to switch in C#:
var x = "some value";
switch( x )
case "some value":
x = 100.10;
case "some other value":
x = 'Go away, or I will taunt you a second time';
throw 'Unexpected value: ' + x;
Note that the default case statement is always optional.
irScript supports fall-through case statements; that is, a case statement without an accompanying break statement will execute statements associated with any case or default statements below it, until a break statement is encountered or the switch statement ends.
Please sign in to leave a comment.