I found this example and it worked for me.GlennD wrote: P.S. Did look up the Game Monkey and it does mention that no switch is available so blocks of if statements it is. :D
Code: Select all
name = "pear";
switch (name)
{
case "apple": { print("hurrah "); print("for apples"); } // braces are required
case "banana": // Fall through multiple cases
case "pear":
case "cherry": { print("fell to fruit", name); }
case favoriteFruit: { print("my favorite fruit"); } // allow variable cases!
default: { print("no fruit for you"); } // Default not required
}
fell to fruit pear