lua-users home
lua-l archive

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


On 25 October 2013 14:13,  <meino.cramer@gmx.de> wrote:
> Choonster TheMage <choonster.2010@gmail.com> [13-10-25 05:08]:
>> On 25 October 2013 14:00,  <meino.cramer@gmx.de> wrote:
>> > Hi,
>> >
>> > (using lua 5.1.5 under Gentoo Linux)
>> >
>> > In a loop I read names of tables from another table.
>> > Which each circle of the loop I read one name off the
>> > table, create some value, which I got from an external
>> > source and want to create a new table with name, which
>> > I read previously from the first table.
>> > How can I do that?
>> >
>> > Thank you very much in adance for any help!
>> >
>> > Best regards,
>> > mcc
>> >
>>
>> Create a table to hold the tables created in the loop and use the names as keys.
>>
>
> Hi Choonster
>
> thank you for your help! :)
>
> Is it possible to create seperate tables instead of tables in a table?
>
> Best regards,
> mcc
>
>
>
>

You could store them in _G (the global environment table). The only
way to associate a value with a name that's stored in a variable is to
use a table, whether that be one you make yourself or _G.