[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Strange behaviour with dofile()
- From: "uGAH man!" <devotion@...>
- Date: Thu, 15 Jan 2004 23:01:57 -0200
Hi... Something strange is happening with the following code:
test.cpp:
extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
int main (int argc, char ** argv)
{
lua_State* L = lua_open();
luaopen_base(L);
return lua_dofile(L,"test.lua");
}
test.lua:
xxx,yyy = dofile()
print(xxx)
print(yyy)
I type "return 1,2,3,4,5" and i see on the stdout "2" followed by "3"...
If i type "return 2,3,4,5", i see 3 followed by 4...
Is this expected? I expected the first two arguments to be printed...
If i type "return 1,2", I see "2" and "nil"...
Any help will be appreciated...
Thanks
-- Fred