Quantcast
WoWInterface - View Single Post - How do you loop k,v pairs to create fontstrings?
View Single Post
05-14-21, 10:11 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,439
You can't pre-determine the order of a table using strings as keys. You could do something like:

Lua Code:
  1. local table = {
  2.         { display="entry", value="One" },
  3.         { display="entry2", value= "Two" },
  4.         { display="entry3", value= "Three" },
  5. }
  6.  
  7. for k, v in ipairs(table) do
  8.     fsname:SetText(v.display) -- set the text to "entry", entry2" ...
  9. -- or
  10.     fsname:SetText(v.value) -- set the text to "One", two" ...
  11. end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote