[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reading a conf file
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 29 Sep 2016 20:14:29 +0200
On Thu, Sep 29, 2016 at 7:40 PM, Russell Haley <russ.haley@gmail.com> wrote:
re-discovered last night: iterating through a table does not guarantee
> the items are in the same order they are created?
ipairs() gives you that guarantee, pairs() definitely does not. It's
a hash map so things can get semi-random.
If order is important, keep another array (with table.insert) of the
keys and use them to iterate through the 'map' of names to values.