Retrieving an ARRAY stored in a TABLE

Hi All

I am trying to store and then retrieve an ARRAY stored in a TABLE. I seem to be able to put it in there, but not get it out. An example of what I am trying to do appears below. The last two lines are failing - and I would love either of them to work. They keep saying that the index ‘feeders’ cannot be found

Any assistance would be appreciated. Thanks


settings <- {};
settings.timer <- 300;
settings.feeders <- [];
feeder <- {}; <- “Jake”;
settings.feeders.push (feeder);

local f = settings.feeders;
server.log (“name” + settings.feeders[0].name);

I cut-and-pasted that code and it worked fine both in the agent and on the device. Perhaps it’s a different part of your code that’s the issue?


Thanks for that Peter. You are right. I guess it is somewhere else in my code that is causing some strange issue. Back to the debugging.