Basic lua: Tables: Difference between revisions
From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
|- | |- | ||
! method 1: automatically generated index values !! | ! method 1: automatically generated index values !! | ||
|- style="max-width: | |- | ||
| <syntaxhighlight> | | style="max-width:700px;" | <syntaxhighlight> | ||
local t = {1, 2, 3, 4, 5, "six", 7, "ate", 9} -- automatically assigns an index number to each value starting from 1. | local t = {1, 2, 3, 4, 5, "six", 7, "ate", 9} -- automatically assigns an index number to each value starting from 1. | ||
Revision as of 16:07, 22 September 2014
Tables are one of the features of Lua script, that make the scripting language so dynamic & easy to use, as they allow us to easily create tables, insert, remove & sort data. Tables are often comprised of arrays that usually involve keywords - or an index number - & a value. Tables can be accessed using multiple different methods.
| < | Index | > |
Creating a table
