Note: This is an archived post that was originally sent to the Hollywood mailing list on Mon, 24 Aug 2009 13:19:26 +0200
But actually
NextItem() returns an index to the current value (item) that is returned (and not to the next value), Otherwise it would not be possible to copy a table, because you would never get the index to the very first element int the table.
"next" is then always a index to "item" in "table" for next, item = NextItem(table[,start]), right?
Yes, the documentation is a little bit wrong here. I'll have to fix this

Actually,
NextItem(), as the very name implies, always returns the *next* item i.e. the item *next* to "start". So if you pass in 0 for start, then
NextItem() will return 1 and the value at index 1. If there's no value at index 1, it will return Nil. Because
NextItem() always returns the next item we need one special case and that is when you want to retrieve the first item: In that case, you need to pass Nil as start. The next item to Nil will always be the first item! And when Nil is returned, there's no next item.
That's about it... I'll fix the documentation now