View Single Post
05/16/23, 04:31 PM   #13
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Not sure what exactly you mean?

tables are quite easy.
They are defined via = {}
and in there is a key = value, pair.
key can be string like "hello" or a number like [1] or even a control or another table or some pointer to another variable,
and value can be about the same
-> That's the only challenging part here that a table could contain other tables.

tables with non-gap numbers like
[1] = "a",
[2] = "b",
[3] = "c",
can be iterated via ipairs function (in defined order 1 to n (here 3)).

And tables with a gap number, or a non-number key like
[1] = "a",
[3] = "c",
or
["a"] = "a",
["b"] = "b",
["c"] = "c",
can be iterated via the pairs function (attention: Will iterate keys in random order! each time)

in lua about everything uses tables so you should get comfortable with these ;-)
https://wiki.esoui.com/LUA_Tables
  Reply With Quote