API:load

Returns a compiled function from the strings provided by function.

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.

Related Functions

 * dofile
 * loadfile
 * loadstring
 * RunScript