WoWInterface - View Single Post - Tables again...
Thread: Tables again...
View Single Post
12-19-19, 06:58 PM   #5
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 264
The "key" to understanding this is that in your example, 1 and 2 are not keys. They are indexes. If you want them to be keys they need to be strings like "1" and "2". The table data structure at the same time handles data accessed via index and key. Tables are also sparse in that the indexes do not have to be contiguous. E.g., you can have t[1], t[7] and t[13] without the expected t[2], t[3], etc. values. And as you have seen you have have arbitrary keys like "hello" and "a".
  Reply With Quote