Switch
Syntax
switch <var>
case <n1>, <n2>, ... <n3>
// do something if <var> is equal to n1, n2, or n3
case <n4>
// do something if <var> is equal to n4
default
// do something if none of the values above matched the variable
endExample
switch 0@
case 1, 2, 3
0ace: "Value is 1, 2, or 3"
case 5
0ace: "Value is 5"
default
0ace: "Value is not 1, 2, 3, or 5"
endLast updated