Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Functions are Block statements.

Here’s a simple example:

Code Block
function APPhello()
  return "Hello";
end 

Arguments are variables which are used to pass data into a function. For example:

Code Block
languagelua
function APPadd(a,b)
  returnlocal 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 morevalues. Return ends function execution and returns the specified values to where the function was called.

See:

Page Tree
root@self
startDepth1

...