lua-users home
lua-l archive

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


There is still one point that doesn't work correct. If the input table has e.g. 10 elements and I overwrite only 5 elements, then 5 old elements are still there. I didn't find a solution to remove the table elements before I push the new ones. If I pop then the complete table is poped. Any ideas?
 
regards
Andreas
 
-- 
Dipl.-Inf. (FH) Andreas Volz, ES1
Elektrobit
Phone: +49 (9131) 7701 167, mailto:Andreas.Volz@elektrobit.com
Fax: +49 (9131) 7701 333, http://www.elektrobit.com

Elektrobit Automotive GmbH, Am Wolfsmantel 46, 91058 Erlangen, Germany
Managing Director Otto Fößel
Register Court Fürth HRB 4886
 


From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br]
Sent: Wednesday, August 29, 2007 11:29 AM
To: lua@bazar2.conectiva.com.br
Subject: RE: Replace LUA table

Thanks.
 
It works by replacing the existing table. I though there's no difference if I delete and recreate a new table at the same place on the stack. The stack looks the same.
 
regards
Andreas
 
-- 
Dipl.-Inf. (FH) Andreas Volz, ES1
Elektrobit
Phone: +49 (9131) 7701 167, mailto:Andreas.Volz@elektrobit.com
Fax: +49 (9131) 7701 333, http://www.elektrobit.com

Elektrobit Automotive GmbH, Am Wolfsmantel 46, 91058 Erlangen, Germany
Managing Director Otto Fößel
Register Court Fürth HRB 4886
 


From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Lua
Sent: Tuesday, August 28, 2007 8:09 PM
To: Lua list
Subject: Re: Replace LUA table

<Andreas.Volz@elektrobit.com> writes:
        lua_newtable(L);              // table

The previous reply shows how you can replace "a" with a new table constructed by your array2table function.  If you want to simply edit the existing "a", just don't create a new table (remove the line quoted above), rather use the existing table on the stack.

Hope that helps,
James.
----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.
----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.