lua-users home
lua-l archive

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


	From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of John Calsbeek
	Sent: Monday, August 27, 2007 4:00 PM
	To: Lua list
	Subject: Re: Passing arrays from C++ to LUA
	
	
> 	After creating the table with lua_newtable, for each item in the array you'd need to push it with lua_pushinteger 
> and add it to the table with lua_rawseti(L, -2, idx). 

Thanks for your answer. I tried it without success. Perhaps you could be a little more concrete. I read the help for the C API docs, but didn't find an answer.

- Do I need the call to lua_settable (L,1);?

- What values has 'idx' in lua_rawseti(L, -2, idx) to be?

- What is the '-2' in lua_rawseti(L, -2, idx)?

Perhaps you could spend some more lines as explanation.

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 <http://www.elektrobit.com/> 

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


----------------------------------------------------------------
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.