lua-users home
lua-l archive

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


On Fri, Nov 19, 2004 at 04:22:41PM +0100, Roland Illig wrote:
> Timur Davidenko wrote:
> >Table = {
> >            <UIWidget="slider" UIMin=0 UIMax=100>
> >            Radius = 10,
...
> >}
> 
> Table = {
>   Radius = {
>     attr = { UIWidget = "slider", UIMin = 0, UIMax = 100 },
>     value = 10
>   },
...
> }
> 
> Something like that?

Or, if your data structure will have multiple instances, use a
separate table for attributes:

TableAttrs = {
	Radius = { UIWidget = "slider", UIMin = 0, UIMax = 100 },
	...
}

Table = {
	-- Could reference the attributes table like this, or put the
	-- attributes in the metatable, etc.
	attr = TableAttrs,
	Radius = 10,
	...
}

-- Jamie Webb