dragon81655

dictionary

Sep 23rd, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. dictionaryTable = {
  2. new = function()
  3. local dic = {list = {}}
  4. dic = {
  5. list = dic.list,
  6. set = function(index, info)
  7. dic.list[index] = info
  8. end,
  9. remove = function(indexL)
  10. index = indexL:lower()
  11. local i = 1
  12. for k,v in pairs(dic.list) do
  13.  
  14. if (k == index) then
  15. --print(k)
  16. dic.list[k] = nil
  17. table.remove(dic.list, i)
  18. end
  19. i = i+1
  20. end
  21. end
  22. }
  23. return dic
  24. end
  25. }
  26. return dictionaryTable
Advertisement
Add Comment
Please, Sign In to add comment