Tao.Lua SDK Documentation

Lua.lua_load Method 

Loads a Lua chunk. If there are no errors, lua_load pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message.

[Visual Basic]
Public Shared Function lua_load( _
   ByVal L As IntPtr, _
   ByVal reader As lua_Reader, _
   ByVal data As IntPtr, _
   ByVal chunkname As String _
) As Integer
[C#]
public static int lua_load(
   IntPtr L,
   lua_Reader reader,
   IntPtr data,
   string chunkname
);

Parameters

L
reader
data
The data argument is an opaque value passed to the reader function.
chunkname
The chunkname argument gives a name to the chunk, which is used for error messages and in debug information.

Return Value

0: no errors. LUA_ERRSYNTAX: syntax error during pre-compilation. LUA_ERRMEM: memory allocation error.

Remarks

This function only loads a chunk; it does not run it. lua_load automatically detects whether the chunk is text or binary, and loads it accordingly (see program luac). lua_load uses a user-supplied reader function to read the chunk (see lua_Reader).

See Also

Lua Class | Tao.Lua Namespace