lua-users home
lua-l archive

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

On Fri, Jul 10, 2009 at 1:22 PM, <> wrote:
> slot_tbl = { 1="ONE",2="TWO"...}

Well, this is actually a syntax error; you can only put the keys like
this if they are valid identifiers.  Now, what do you want this to

1)   {[1]="ONE",[2}="TWO"}
2)   {["1"]="ONE",["2"]="TWO"}

These are very different.  If it's 1), then why not say?

3) {"ONE","TWO"}

If using numeric keys like this, and you _do_ want the order, then use ipairs

steve d.