Tao.Lua SDK Documentation

Lua.lua_tolstring Method 

Converts the Lua value at the given acceptable index to a string (const char*). If len is not NULL, it also sets *len with the string length. The Lua value must be a string or a number; otherwise, the function returns NULL. If the value is a number, then lua_tolstring also changes the actual value in the stack to a string. (This change confuses lua_next when lua_tolstring is applied to keys during a table traversal.)

[Visual Basic]
Public Shared Function lua_tolstring( _
   ByVal L As IntPtr, _
   ByVal idx As Integer, _
   ByRef len As Integer _
) As IntPtr
[C#]
public static IntPtr lua_tolstring(
   IntPtr L,
   int idx,
   out int len
);

Parameters

L
idx
len

Return Value

lua_tolstring returns a fully aligned pointer to a string inside the Lua state. This string always has a zero ('\0') after its last character (as in C), but may contain other zeros in its body. Because Lua has garbage collection, there is no guarantee that the pointer returned by lua_tolstring will be valid after the corresponding value is removed from the stack.

See Also

Lua Class | Tao.Lua Namespace