YENGswitch

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
 
break, default and '...' are keywords used with it.<br>
 
break, default and '...' are keywords used with it.<br>
  
examples
+
simple string (command) example:
  
 
  switch (command)
 
  switch (command)

Revision as of 15:01, 19 September 2020

switch can only work in integer expressions, or strings
break, default and '...' are keywords used with it.

simple string (command) example:

switch (command)
{
    case "turnleft":
    {
        TurnLeft ();
        break;
    }
    case "turnright":
    {
        TurnRight ();
          break;
    }
    default: llOwnerSay ("dont know how to handle " + command);
}
Personal tools
General
About This Wiki