Skip to content

Legacy documentation

Matto edited this page Jan 14, 2023 · 1 revision

This is legacy, get the new docs here!

Object con

Description

The console object for manipulating text in the console.

Function con.out <addNewLine="nl"|(any)> <text=(any)|$(varname)>

Description

Prints <text> to the console.

Arguments

  • <addNewLine>
    • Whether or not to add a new line. "nl" if yes, anything else if no.
  • <text>
    • Text to print. If preceded with a dollar sign ($), prints the variable $(varname).

Example

con.out nl Example

Possible errors

  • MTS-4: UnassignedVar

Object flex

Description

The FLEX (FiLe EXecutor) object.

Object flex.file

Function flex.file.exec <filename=(any)>

Description

Executes another file.

Example

flex.file.exec hworld.mts

Possible errors

  • MTS-3: FileNotFound

Function flex.file.loadVars <filename=(any)>

Description

Loads variables from another file.

Arguments

  • <filename>
    • File name.

Example

flex.file.loadVars hworldvar.mts
con.out nl $hworld

Possible errors

  • MTS-3: FileNotFound

Object func

Description

The object for creating and calling user functions.

Function func.start <funcname=(any)>

Description

Initiates the function named <funcname>.

Arguments

  • <funcname>
    • Function name.

Example

func.start main
	con.out nl Hello World!
func.end

Function func.end

Description

Ends the function.

Example

func.start main
	con.out nl Hello World!
func.end

Function func.call <funcname=(any)>

Description

Calls the function named <funcname>.

Arguments

  • <funcname>
    • Function name.

Example

func.call main

No-object

Function var <name=$(varname)>=<val=(any)>

Description

Sets to variable .

Arguments

  • <name>
    • Variable name. If not preceded with a dollar sign, variable will not be usable.
  • <val>
    • The value to assign to the variable. Cannot contain an equals sign.

Example

var $example=Example

Function halt

Description

Halts the program.

Example

halt