lua-users home
lua-l archive

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


Am 16.12.10 21:01, schrieb Luiz Henrique de Figueiredo:
>> 	hdf.bset = {}
>> 	for n = 1, res:ntuples() do
>> 		hdf.bset[n] = {}
>> 		hdf.bset[n].id = res:getvalue(n, 1)
>> 		hdf.bset[n].name = res:getvalue(n, 2)
>> 		hdf.bset[n].description = res:getvalue(n, 3)
>> 	end
> 
> This can be simplified to
> 
> 	hdf.bset = {}
> 	for n = 1, res:ntuples() do
> 		hdf.bset[n] = {
> 			id = res:getvalue(n, 1),
> 			name = res:getvalue(n, 2),
> 			description = res:getvalue(n, 3)
> 		}
> 	end

For some reason this does not work.  Must be my C code....  Or Lua
accesses the fields in a different order.