Tao.Lua SDK Documentation

Lua.luaL_checkoption Method 

Checks whether the function argument narg is a string and searches for this string in the array lst (which must be NULL-terminated). Returns the index in the array where the string was found. Raises an error if the argument is not a string or if the string cannot be found.

[Visual Basic]
Public Shared Function luaL_checkoption( _
   ByVal L As IntPtr, _
   ByVal narg As Integer, _
   ByVal def As String, _
   ByVal lst As String() _
) As Integer
[C#]
public static int luaL_checkoption(
   IntPtr L,
   int narg,
   string def,
   string[] lst
);

Parameters

L
narg
def
lst

Return Value

Remarks

If def is not NULL, the function uses def as a default value when there is no argument narg or if this argument is nil. This is a useful function for mapping strings to C enums. (The usual convention in Lua libraries is to use strings instead of numbers to select options.)

See Also

Lua Class | Tao.Lua Namespace