/
Functions
Functions
This is a central concept in writing good code. A function allows you to make a small piece of code which does one thing well and often can be reused if the same functionality is needed in multiple places. Functions apply a core design principal: separation of concerns.
Functions are Block statements.
function APPadd(a,b)
local sum = a + b
return sum
end
local sum = APPadd(2,3) -- returns 5
Arguments (ex. a,b) are variables which are used to pass data into a function.
Functions can return one or more values. Return ends function execution and returns the specified values to where the function was called.
See:
, multiple selections available,
Related content
Strings
Strings
Read with this
Function scope
Function scope
More like this
Parts of an Integration
Parts of an Integration
Read with this
Recursion
Recursion
More like this
Variables
Variables
Read with this
Javascript Closure
Javascript Closure
More like this