legaliceit

Multidimensional Table Problem

Nov 6th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. --Hi. I want to set a variable inside a multidimensional table using the entrys from a table.
  2. --A simple example of what i am trying to do :
  3.  
  4. -- table with the keys :
  5. local tTablePath = {"Key1", "Key2", "Key3"}
  6.  
  7. -- The multidimensional table :
  8. local tTheOtherTable = {}
  9. tTheOtherTable["Key1"] = {}
  10. tTheOtherTable["Key1"]["Key2"] = {}
  11. tTheOtherTable["Key1"]["Key2"]["Key3"] = {}
  12.  
  13. --I want to change the value of <tTheOtherTable["Key1"]["Key2"]["Key3"]> but i only have the keys in the table <tTablePath>. How can i do this?
Advertisement
Add Comment
Please, Sign In to add comment