Newbie strike again !!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie strike again !!

Christophe Gimenez
Okay , here is what I've done :

in a C++ file :

- create a global var
- register a new function to LUA
- launch execution of the LUA script
- LUA script call the registered function with a double as parameter
- the C function modify the global var

- before exiting the C program displays the global var to see if all works fine.

// --------------------------------------------------------

Here is the next problem :

I would like to PUSH a pointer to LUA (ok that a usedata lua object).
It seems (not sure) that I must use "tags"...
Unfortunately I don't understand what tags are ??
And, of course, if they are the solution to pushing and poping pointers 

thanks

Really I start to like LUA a lot !!

Reply | Threaded
Open this post in threaded view
|

Re: Newbie strike again !!

Luiz Henrique de Figueiredo
>From: Christophe Gimenez <[hidden email]>
>
>I would like to PUSH a pointer to LUA (ok that a usedata lua object).

use lua_pushuserdata(u), where u is your pointer.
this is will tag u with the default tag.

>It seems (not sure) that I must use "tags"...

you may use the default tag, as explained above.

>Really I start to like LUA a lot !!

so do we. :-)
--lhf