API:load

__NOTOC__
load
Returns a compiled function from the strings provided by function.
load(func [, chunkname])
== Parameters ==
=== Arguments ===
:;func
::function - Repeatedly called to load a chunk from pieces. Each call to func must return a string that concatenates with previous results. A return of an empty string, nil, or no value signals the end of the chunk..
:;chunkname
::string - chunkname is used as the chunk's designation for error messages and debug information. When absent, it defaults to "=(load)".
=== Returns ===
:;function
::function - If there are no errors, returns the compiled string as a function; otherwise, returns nil. The environment of the returned function is the global environment. 
:;error
::string - If there are no errors, returns nothing; otherwise, returns the error message.
== Example ==
The result is the character waves and a warning message of "OMG, HI!" flashes on the screen.
local function getitr(ary)
 local x=0
 return function()
 x=x+1
 return ary[x]
 end
end
local cmds={"DoEmote(4)", "SendWarningMsg(\"OMG, HI!\")"}
local f = load(getitr(cmds) , "Load Example")
f()
== Notes ==
* http://www.lua.org/manual/5.1/manual.html#pdf-load
== Related Functions ==
* dofile
* loadfile
* loadstring
* RunScript