Page 1 of 1

switch syntax flexibility

PostPosted: Tue Jan 17, 2012 2:04 pm
by JvNoort
Hello

Is it possible in (future) version of Rhino, to get javascript syntax like:
Code: Select all
   switch (sDestType) {   

   case "foo":
            ... stuff
                break;
                  
   case "this", "that":
           ... other stuff
           break;                  
   }

Say, now I don't know how to make case "multi" working...

Reards, Jan

Re: switch syntax flexibility

PostPosted: Tue Jan 17, 2012 3:03 pm
by ROCLASI
Hi Jan,

You can use the following syntax:
Code: Select all
   switch (sDestType) {   

   case "foo":
            ... stuff
                break;
                 
   case "this":
   case "that":
           ... other stuff
           break;                 
   }


( Now you know what the break is for ;) )

Hope this helps.