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
- Flow control - if, elseif, else
- Flow Control - switch, case, default
- Flow Control - loops
- Classes
- Classes API
- Functions
- BuiltIn functions
- Functions
- Operators
- Syntax
- Events
- MinitScript, see README.md
- MinitScript - How to build, see README-BuildingHowTo.md
- MinitScript - How to use, see README-Tools.md
- MinitScript - ToDo list, see README-ToDo.md
- The Mindty Kollektiv Discord Server