LuaScript Xojo and Real Studio Plugin

LuaScriptContext.NewTable Method (console safe)

Creates a new empty table structure.

NewTable()

Parameters

Remarks

After this function has been executed then the new table will be at top of the stack.

Dim i as Integer

lua.NewTable()

for i = 1 to 5
    lua.Push(i) // Push the table index
    lua.Push("Some cell text: " + Str(i * i)) // Push the cell value
    lua.SetTableValue() // Store the pair in the table
next

lua.SetGlobal("foo") // Expose the table to Lua as "foo"

See Also

LuaScriptContext Class