lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2014-07-29 17:14 GMT+02:00 Thiago L. <fakedme@gmail.com>:


2014-07-29 16:39 GMT+02:00 Alex Queiroz <asandroq@gmail.com>:
Hallo,

On Tue, Jul 29, 2014 at 4:33 PM, Benoit Germain <bnt.germain@gmail.com> wrote:

Any thought about this?


Can't you sort the data?

Cheers,



As others stated, not without changing the file contents to convert all tables to indexed lists.

Originally, I started with the idea that executing the script amounts to loading the data. Once it is done, I transfer the contents in my C structures by indexing the created tables by field names. All this uses macros with stringification because the keys in the Lua tables have the same names as my C members.
*And*, I have also other Lua code that relies on this format. Namely, I have another Lua script that describes a data format, and an IUP-based module that generates an IDE to edit, load, and save the data. Unfortunately, everything would break if I changed my data format to lists, so that's not really an option.


--
Benoit.