Sounds like you need to double check how your keys are defined, then. I would start there. If you use pairs it will iterate over any keys in the table, and unless you have perfectly sequenced integer keys starting at 1 the order is undefined. ipairs will only iterate over perfectly sequenced integer keys starting at 1 and do so in order, but that doesn't help if your keys are broken in the first place.
# just returns the length of a table or a string. There shouldn't be anything unintuitive about it. Although for tables it once again requires sequenced integer keys starting at 1 to give the expected result.
Edit: Oh, okay. Glad to hear you got it sorted!
__________________
Grab your sword and fight the Horde!
|