lua-users home
lua-l archive

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



Ok, make that lua_pushnumber(L,i+1);

Thats what I get for coding at 5am...

Thanks

From: PINELLI Thierry SGAP Marseille <thierry.pinelli@interieur.gouv.fr>
Reply-To: Lua list <lua@bazar2.conectiva.com.br>
To: Lua list <lua@bazar2.conectiva.com.br>
CC: lua@bazar2.conectiva.com.br
Subject: Re: C Function returning a table to LUA?
Date: Mon, 29 Sep 2003 10:59:25 +0200

On Mon, Sep 29, 2003 at 04:44:08AM -0400, Jason P wrote:


> for (int i = 0; i < NumFileNames; i++)
> {
>     lua_pushnumber(L,i);
>     lua_pushstring(L,MyFileNames[i]);

Are your sure ?
Lua's tables' indexes begin to 1 ?

>     lua_settable(L,-3);
> }
> return 1;
>

_________________________________________________________________
Get McAfee virus scanning and cleaning of incoming attachments. Get Hotmail Extra Storage! http://join.msn.com/?PAGE=features/es