lua-users home
lua-l archive

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


On Mon, 23 Jun 2003, Peter Shook wrote:

> 
> Bob Smith wrote:
> > My result when calling a() would be "outa" when I would expect only "a"
> > Is this because I am using lua_dofile(...) then lua_getglobal(..., "a") 
> > and finally a lua_pcall(...)
> 
> Yes, that's all you need to do if you just want to call function 'a'
> 
> lua_getglobal(L, "a");
> lua_pcall(L, 0, 0, 0);
> 
> - Peter Shook
 
Yeah I get the result of the function but I also get the result of 
everything else not inside the function. So if I had 10 io.write 
statements outside functions, I would get those outputed as well as the 
execution of the function. Is this an expected result?