I store ADC samples in a Lua table and mark failed readings by assigning nil to that position. After that, #samples sometimes returns the full count and sometimes a smaller number, and my for i = 1, #samples loop stops early. A second table that uses string keys always reports a length of 0.
How is the length of a table actually defined, and what is the correct way to count the entries?




