lua-users home
lua-l archive

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


>I am currently integrating Lua to a project of mine, and I have run into 
>a problem: Looking through the various docs for Lua, I have found none 
>that prototypes precisely the functions' return values. For instance, 
>the code executing functions lua_do* have documented error codes, 
>whereas lua_getglobal and setglobal have none.

Which version of Lua are you using? In Lua 4.0 (the current official version),
lua_getglobal and lua_setglobal are void, ie, do not return anything.
In Lua 5.0, these are macros, but still do not return anything.

>So I am guessing that these functions all follow the standard "0 on 
>success / other on error" pattern. But is there any reference list that 
>would also list error codes that may be returned for each function?

The reference manual should be explicit about all this. If not, please let us
know.
--lhf