RDNWiki: DOWScar/Functions/Table ...

RDN Wiki Home | Page Index | Recent Changes | Recently Commented | Users | Registration | Login:  Password:  

Table Data Type


Contents


Table data type is the LUA data type for storing groups of objects. Any objects, even other tables, can be put into a table.


StringTable is a specific type of tables, ie: those functions that use them specifically want a table of strings. Mentions of LuaTable are basically the same as Table.


See the LUA tables tutorial for more specific LUA information on tables.

Example Code

function Test()
	-- Example tables from the LUA types tutorial: http://lua-users.org/wiki/LuaTypesTutorial
	-- Declare a table
	local mytable = { value = 123, text = "hello" }

	-- Test mytable
	print(mytable.value)
	-- 123
	print(mytable.text)
	-- hello

	-- Putting tables into other tables
	local bigtable = { const={ name="Pi", value=3.1415927 }, const2={ name="light speed", value=3e8 } }

	-- Test bigtable
	print(bigtable.const.name)
	-- Pi
	print(bigtable.const2.value)
	-- 300000000
end

Links


Data Types
Functions
SCAR Home
Wiki Home

End of Page

There are no files on this page. [Display files/form]
There is no comment on this page. [Display comments/form]