[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question on reading config files
- From: Coda Highland <chighland@...>
- Date: Tue, 17 Jul 2012 00:22:34 -0500
> Hi Coda,
>
> yes, I see, that I get only the refrence to the first table...but
> again my question:
>
>
>> > What do I have to change to get the table names ('first",'second')
>> > instead of the adress of the table 'profile" (as it seems, since it
>> > is only one adress printed) ?
>
>
> Thank you very much for any help in advance!
>
> Best regards,
> mcc
Did you read the code I included? I'll repeat it here:
> function profile (cfg)
> for key, value in pairs(cfg) do
> print( key )
> print( value )
> end
> end
Do note the difference between yours and mine: You're using (...)
while I'm using a named parameter. This named parameter is the table
passed to profile(), and so pairs() is iterating over its members
instead of iterating over the parameters to the function.
/s/ Adam