MinitScript supports module script files, in short modules, including the transpilation of them.
You are declaring a script file as module script file by the "module" statement. Module script files are only allowed to have functions, callables and stacklets.
This is module_1.tscript, which will be used in module-test.tscript in section 1.2.
module
# this function is provided by our module_1.tscript
function: module1Function()
console.printLine("-----------------")
console.printLine("module1Function")
console.printLine("-----------------")
end
You are including a module by the "use: " statement. After the colon the relative path to the script module file is required. Note that modules can also include modules.
See a module-test.tscript, which uses module_1.tscript from the section 1.1. above.
use: module_1.tscript
# initialize
on: initialize
console.printLine("-------------------------")
console.printLine("module-test: Initialize")
console.printLine("-------------------------")
console.printLine()
end
# main
function: main()
console.printLine("-----------------------")
console.printLine("module-test: Nothing")
console.printLine("-----------------------")
console.printLine()
# call module 1 functions
console.printLine("main: Calling module1Function() from module_1.tscript")
module1Function()
end
- 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
