What Is A Table And What Is A Array?

What is a table and what is an array because I read about both but I dont understand how they are different because they look the same so does one have more than one kind of thing of information in each bit of it and the other just has one or what is the difference?

Hi Bud,

In Lua, a table is effectively an array… you can add items to it, either as “dictionary” items (named items like “apple” or “watermelon” with an associated value), but also, “indexed” items simply in a numerical order, and referenced by that position within the table (array).

And, many things in Corona are actually tables too, even if you wouldn’t normally consider them as an array. For example, a display object or sprite is actually a table.

I think this tutorial will help explain it better for you:

http://www.coronalabs.com/blog/2011/06/21/understanding-lua-tables-in-corona-sdk/

Regards,

Brent

Hi Bud,

In Lua, a table is effectively an array… you can add items to it, either as “dictionary” items (named items like “apple” or “watermelon” with an associated value), but also, “indexed” items simply in a numerical order, and referenced by that position within the table (array).

And, many things in Corona are actually tables too, even if you wouldn’t normally consider them as an array. For example, a display object or sprite is actually a table.

I think this tutorial will help explain it better for you:

http://www.coronalabs.com/blog/2011/06/21/understanding-lua-tables-in-corona-sdk/

Regards,

Brent