lua-users home
lua-l archive

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


Oh, I think i didn't explain then problem clearly. I have changed my code so the problem disppear.

what i want to know is that when i write lua code like "GetValue( 0, table )" . what is the 0's type, number or string ?
I got the result that 0's type is string.




At 2012-07-16 17:13:34,"Joshua Phillips" <jp.sittingduck@gmail.com> wrote: >On Mon, Jul 16, 2012 at 04:56:38PM +0800, zaker wrote: >> I use "lua_rawseti(L, -1, 0)" to set a table's 0 index.   > >I think lua_rawseti(L, -1, 0) corresponds to v[0] = v, which is probably >not what you want. You probably want lua_rawseti(L, -2, 0).  > >> 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 )". > >Well this is no help without knowing how GetValue is defined. > >> Is there any rules how lua parse number ? > >Of course, but that doesn't seem relevant to this. >