That works like a charm, thanks.
How would a register an "assignment" protocol to the object in addition to the indexer? Or, if the indexer has to go, then just the assignment protocol. So I can assign a table and then walk it to get the values. If you could help point me in the right direction there it would be much appreciated.
Oh, just a quick question. Is the UnhandledReader/UnhandledWriter support for array-like access only, or can it be used for assignment in a "ar = {}" command?
Edit:
Actually, now that I think about it more, I'm going to end up with a "recursive" associative array that will end up providing my templates. So maybe registration of the type is unnecessary. Instead I could, like you advised awhile back, use a surrogate function and pass the table plus an identifier string to a function.
So since I'm still unclear as to how, how would I declare/register a function to accept two parameters (first a string, then a table) and then in the function begin to walk the table into an associative array?
EG:
Code:
MyStuff = {
"var1" = "whatever",
"var2" = 42.42424242
}
AddTemplate('TMyStuff:2001', MyStuff);
I kinda understand how to use the function lua_next to walk the table, but not how to get the table's ID and then pass through the walk-loop. You don't need to write it all, I just need to understand Lua's stack concept--which is kinda painful.
Bookmarks