Once a function is declared, it can be executed by calling it. To call a function, simply type its name, followed by parentheses. For example, to read input from the console, you call io.read(). The following snippet demonstrates how to declare and call your own function:
print ('about to declare the PrintSomething function');
function PrintSomething() -- declare the function
print ('hello, world')
end
print ('the PrintSomething function is declared');
print ('calling the PrintSomething function');
PrintSomething(); -- call the function
print ('called the PrintSomething function');