ReCT Documentation

v2.1

Functions


Functions are a way to block off code and re-use it.

Functions can have Parameters and can also return objects.



Declaring a Function could look like this:

function someFunc() { ... }

To add Parameters, you can just put them inside the parentheses and specify a Datatype:

function someFunc(someParam -> string, someOtherParam -> int) { ... }

To specify a return Type, just add a Datatype after the parentheses:

function someFunc() -> string { ... }

Calling a Function

Calling a Function is pretty easy.

Just write the Function's name and some parentheses after it, and if you have Parameters set you will have to put them in there.

someFunc()
someFuncWithParams("this is an parameter", 123)

Static Functions

When the Class the Function is in is static, the Function will automatically be static as well.