[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Table element addressing syntax
- From: "Curt Carpenter" <curtc@...>
- Date: Tue, 27 Nov 2001 00:12:53 -0800
> untested code:
>
> function GetElement(table, field)
> local pos = strfind(field,".")
> if pos then
> return GetElement(table[strsub(field,1,pos-1)],
strsub(field,pos+1))
> end
> return table[field]
> end
That's a step in the right direction. I guess for an arbitrary field
string, which may have any number of periods, you just iteratively get
the next table, get the appropriate field, rinse, and repeat.
Thanks,
Curt