Switch, case, and default are flow control methods too. Please see the usage below.
See an example:
...
#
$i = 1
switch($i)
case(0)
console.printLine("$i = 0")
end
case(1)
console.printLine("$i = 1")
end
case(2)
console.printLine("$i = 2")
end
default
console.printLine("default: $i = " + $i)
end
end
...
Please note, default block is optional.
- Syntax
- Data types, variables and constants
- Flow control - if, elseif and else
- Flow control - switch, case and default
- Flow control - forTime, forCondition, for and forEach
- Flow control - exceptions
- Functions
- Lambda functions
- Classes
- Modules
- Built-in functions
- Built-in classes
- Operators
- Constants
- MinitScript, see README.md
- MinitScript - How to build, see README-BuildingHowTo.md
- MinitScript - How to use, see README-Tools.md
- The Mindty Kollektiv Discord Server