Originally Posted by Tar000un
Hmm why i read it as a table ?
Ok, time to sleep i think. x)
|
The Saved Var acessor object can also be read as a table (int and string indexes). Yet also #SavedVarAccessor will return 0.
My best guess is that they
fake those two being a table via metafunctions (specifically they have
some code for indexing attempts on not-really existing indexes). And they just did not bother to give # a proper meta function, so it won't return anything usefull.
is equal too
Code:
SavedVar["SomeValue"]
is equal too
Code:
SavedVar.[metatable].getIndex("SomeValue")
Edit: That could mean that "ZO_LinkHandler_ParseLink()" is not actually
parsing the link and giving you a table interpretation.
Instead it returns an object that encapsulates the link and gives you some functions to extract data from contained link. It just hides the fact that those are functions behind a fake table.
Edit2: More correct the final piece of code would look like this:
Code:
getmetatable(SavedVar).__index(SavedVar, "SomeValue")