I’m trying to reference a table but having difficulty. Below is a bit of the code i’m using. I need to reference the devs_304 table, but it requies a non–string value (See below). I need to concatentate some text along with a number to reference the correct table. How can I do this? Thanks for the help
function watch_device(dev_id, service, variable, old_val, new_val)
devs = {304, 626, 25}
devs_304 = {276, 313}
for a, devs_match in ipairs(devs) do
if (devs_match == dev_id) then– THIS IS THE LINE IN QUESTION
my_devs = devs_304 – THIS WORKS BECUASE I’M DIRECTLY REFERENCING IT
my_devs = “devs_” … dev_id – PRODUCES A STRING, BUT NEEDS TO BE NON-STRING?end
end