lua-users home
lua-l archive

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


I use "lua_rawseti(L, -1, 0)" to set a table's 0 index.  
And I write a function that will get the entry from table. The function prototype is "GetValue( index, table )".
I just can't get the value by "GetValue( 0, table )" or "GetValue( '0', table )".

But it's ok when use terminal
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> t = {}
> t[0] = 1
> print(t[0])
1
> print(t['0'])
nil

Is there any rules how lua parse number ?