Page 1 of 1

lua library

Posted: Tue Nov 20, 2007 3:10 pm
by jorgejones
i refer from http://www.purebasic.fr/english/viewtop ... a&start=15
where i could find the includes for lua5.1

however when i try the example with the custom average function it returns 0.0 in both return values

anyone know how to solve this?

ps: is there any static lib of lua51 to avoid dll?

Posted: Wed Nov 21, 2007 1:38 am
by hallodri

Re: lua library

Posted: Wed May 14, 2008 10:37 pm
by SofT MANiAC
jorgejones wrote:i refer from http://www.purebasic.fr/english/viewtop ... a&start=15
where i could find the includes for lua5.1

however when i try the example with the custom average function it returns 0.0 in both return values
Anyone knows how to solve this?

Code: Select all

ureBasic: Registering function 'average' to LUA...
ureBasic: Execute LUA file 'average.lua'...
     LUA: Calling registered PureBasic function 'average'
     LUA: Passing the return values back to PureBasic
ureBasic: Got back the value #1 (sum of arguments) from LUA    : -1.#IND00
ureBasic: Got back the value #2 (average of arguments) from LUA: -1.#IND00

Posted: Thu May 15, 2008 11:38 am
by SofT MANiAC
Now I know - it's a floats issue. I'm solved this with pointers and PeekF()