[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Another table question...
- From: Eugen-Andrei Gavriloaie <shiretu@...>
- Date: Thu, 10 Apr 2008 00:19:18 +0300
On Apr 9, 2008, at 11:50 PM, Javier Guerra wrote:
On Wed, Apr 9, 2008 at 3:39 PM, Eugen-Andrei Gavriloaie
3. We now try to add a new value using your method. Let this value
string "this is a string". lua_objlen(L, -2) + 1 evaluates to 4 in
lua_objlen(L, -2) is the same as #t, and it returns a number such that
t[n] is not nil and t[n+1] is nil. in this case it could be 1 or 4,
so lua_objlen(L, -2) + 1 could be 2 or 5, both of wich are empty
Ahaaa!!! This is what I was missing! :)
Anyway, made a test app and I was preparing to ask why the # operator
applied on a table with 3 elements reports 4. But this is the answer.
Thank you so much!