PtokaX forum

Stuff => Offtopic => Topic started by: pHaTTy on 07 May, 2004, 04:22:44

Title: lua integrate
Post by: pHaTTy on 07 May, 2004, 04:22:44
hmm ok i been searching all day to try find the answer, first place to ask is here.......

int test(lua_State* L)
{
cout <<"test\n";
return 0;
}

ok calling this from my test app is fine....

matta of:

test()

but if i want

test("some text")

what now? =S

int test(lua_State* L, const char* str)
{
cout << str << "test\n";
return 0;
}

this returns

error C2664: 'lua_pushcclosure' : cannot convert parameter 2 from 'int (struct lua_State *,const char *)' to 'int (__cdecl *)(struct lua_State *)'

anyone? =S
Title:
Post by: pHaTTy on 07 May, 2004, 21:04:17
while at it, anyone know the header to include for os.clock()

?? :s
Title:
Post by: pHaTTy on 08 May, 2004, 13:06:44
nm got it

int printt(lua_State* L)
{
cout << lua_tostring(L, -1);
return 0;
}