ufdeck.blogg.se

Lua table insert end
Lua table insert end











lua table insert end

I'm going back to C# when this class is done. I'm having so much fun with this language - you can tell by my blank expression.įrom the language without line endings or brackets, but forced print parentheses. Solution is basically, "oh it's just one of those Lua things". Just wanted to "answer" saying no need to help. The latter can have numerical indexes or any other valid data type. table.key value is syntactic sugar for tablekey value, which inserts the item into the array’s map. Anything inserted into a table from table.insert has a numerical index. I apologize for not posting the solution right now. table.insert inserts an element into an array with optionally a position to place it at. I'll keep the old post for archival purposes.

lua table insert end

This was posted here to reserve my spot for an answer so I could edit it later when I returned back home, which is exactly what I'm doing right now. (Commented parts are other attempts, although many attempts have been deleted already) Animator = ClassĮdit: I'm fully aware of how to use answers. Here's my code: (let me know if you need to see more) The length operator is also useful for adding elements to the end of an array. Unfortunately, the global table always comes back nil. A Lua array is a table with values assigned to sequential integer keys. Basically, it's a filename, and I'm pairing it up with data about the file. The key name is pulled from the function arguments. I have a Lua function where I build a table of value and attempt to add it to a global table with a named key.













Lua table insert end