View Single Post
10-13-17, 07:06 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
pairs returns the key, value pairs in a table

Code:
self.tab = {
      key1 = 1,
      key2 = { a=1, b=2 },
      key3 = "Hello"
}

for key, value in pairs(self.tab) do
    -- This will return over the 3 iterations (in no particular order)
    key == "key1", value == 1
    key == "key2", value == (pointer to the table)
    key == "key3", value == "Hello"
end
You can replace the key, value terms with any names that suit the situation.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-13-17 at 07:10 PM.
  Reply With Quote