Tao.Lua SDK Documentation

Lua.lua_getupvalue Method 

Gets information about a closure's upvalue. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.) lua_getupvalue gets the index n of an upvalue, pushes the upvalue's value onto the stack, and returns its name. funcindex points to the closure in the stack. (Upvalues have no particular order, as they are active through the whole function. So, they are numbered in an arbitrary order.)

[Visual Basic]
Public Shared Function lua_getupvalue( _
   ByVal L As IntPtr, _
   ByVal funcindex As Integer, _
   ByVal n As Integer _
) As String
[C#]
public static string lua_getupvalue(
   IntPtr L,
   int funcindex,
   int n
);

Parameters

L
funcindex
n

Return Value

Returns NULL (and pushes nothing) when the index is greater than the number of upvalues. For C functions, this function uses the empty string "" as a name for all upvalues.

See Also

Lua Class | Tao.Lua Namespace