Page 1 of 1

switch syntax flexibility

PostPosted: Thu Sep 22, 2011 2:07 pm
by JvNoort
Hello again,

Can it not be arranged in "Rhino" that a switch statement can handle more args in a case:

I tried to use in a calculation:

Code: Select all
switch (mycase) {

      case "red", "yellow": Do this
      break;
      case "green" : Do that
}


switch syntax didn't recofnize that. (Am i right ? :idea: )
So, is it not a good idea to add syntax possibilities like case <50, >= 100:
etc....

Re: switch syntax flexibility

PostPosted: Thu Sep 22, 2011 7:41 pm
by kwpsd
Try this:

Code: Select all
switch (mycase) {

      case "red":
      case "yellow":
            Do this
            break;
      case "green" :
            Do that;
            break;
}