RosettaCodeData/Task/Conditional-structures/TorqueScript/conditional-structures-2.torque

30 lines
351 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
// numbers and objects
switch(%num)
{
case 1:
one();
case 2:
twoThreeOrFour();
case 3:
twoThreeOrFour();
case 4:
twoThreeOrFour();
case 5:
five();
case MyObject.getID():
anObject();
default:
everythingElse();
}
// strings
switch$(%str)
{
case "Hello":
arrival();
case "Goodbye":
departure();
default:
somethingElse();
}