View Single Post
07/01/14, 01:17 PM   #19
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
This isn't really related. As Garkin indicated, the function ZO_LinkHandler_ParseLink doesn't return a table but a list of values.

----------------------------------------------------------------------------------------

Yes, the # operator does not go through the __index function of a metatable. However, more relevant for your SavedVars scenario is it completely fails for string keys. Consider this (from Lua console):

Lua Code:
  1. > t = {[1] = "a", [2] = "b", [6] = "d", foo = "e" }
  2. > = #t
  3. 2

The # operator only looks at the part of the table that is a well-formed array, with indices {1, 2, 3, ...} consecutively. So the string key is ignored, as well as the 6 (since there's no 4 or 5 key).
  Reply With Quote