Originally Posted by gempir
Could you explain why the [1] is there?
Lua Code:
SkadaDB = { ... ["profiles"] = { ["Default"] = { ["windows"] = { { ["barheight"] = 12, ... }, -- [1] ["x"] = -50, }, ... }, }, }
|
Notice that
["barheight"] = 12 is part of a table inside the windows table, the data isn't in the windows table itself. This inner table is at index 1 of the windows table.
When you put values without keys inside a table constructor, Lua will assign them consecutive integer keys starting from 1 (i.e. they're treated like values of an array). This is explained in more detail in the
Reference Manual.