new
(
)
__gc
(
)
__eq
(
DataTable
rhs
)
->
(
boolean
)
__len
(
)
->
(
integer
)
at
(
string
key
)
->
(
primative
)
at
(
string
key
,
primative
value
)
->
(
DataTable
)
push
(
primative...
values
)
->
(
DataTable
)
pairs
(
function
handler
)
->
(
DataTable
)
ipairs
(
function
handler
)
->
(
DataTable
)
remove
(
string...
keys
)
->
(
DataTable
)
new
(
)
__gc
(
)
__eq
(
DataTable
rhs
)
->
(
boolean
)
__len
(
)
->
(
integer
)
at
(
string
key
)
->
(
primative
)
at
(
string
key
,
primative
value
)
->
(
DataTable
)
push
(
primative...
values
)
->
(
DataTable
)
DataTable = import("DataTable") array = DataTable.new() array:push(5) am_log("Size 1: " .. #array) -- Outputs: Size 1: 1 array:push("String", true) am_log("Size 2: " .. #array) -- Outputs: Size 2: 3
pairs
(
function
handler
)
->
(
DataTable
)
DataTable = import("DataTable") table = DataTable.new() table:at("num", 5) table:at("str", "String") table:at("bool", true) table:at(1, "one") table:at(2, "two") table:pairs(function(key, value)\n am_log(key .. " = ", value) end) -- The output order is not gurrantied -- 1 = "one" -- 2 = "two" -- "num" = 5 -- "str" = "String" -- "bool" = true
ipairs
(
function
handler
)
->
(
DataTable
)
DataTable = import("DataTable") table = DataTable.new() table:push("one", "two", 3) table:ipairs(function(index, value)\n am_log(index .. " = ", value) end) -- The output order is not gurrantied -- 1 = "one" -- 2 = "two" -- 3 = 3
remove
(
string...
keys
)
->
(
DataTable
)
DataTable = import("DataTable") table = DataTable.new() table:at("num", 5) table:at("str", "String") table:at("bool", true) am_log("Size 1: " .. #table) -- Outputs: Size 1: 3 table:remove("num", "bool") am_log("Size 2: " .. #table) -- Outputs: Size 2: 1