Crea sito

3.2.9 sub



Description:


You can declare a subprogram to reuse parts of code when they are recurrently needed in your program.

A sub must be declared at before the program beging keyword and can't receive arguments as input (you can use global variable instead).

Declaration:


beginSub sub_name
...sub content...
endSub


Invocation:


sub sub_name


Example:


You can declare more than one sub as follows (before the begin keyword of your program!)


And then invoke it from your program: