lua-users home
lua-l archive

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


In the book Programming in Lua, pages 193...197 show you how to do this.
Author: Roberto Ierusalimschy

I think a new edition of the book has since been released.

Stephen

Stevo wrote:
> Hello,
> i am developing a small application for controlling a robot unit. In
> this program is use lua to run scripts which move the robot by calling
> the functions of the c program. This works fine but now i would like
> to implement a variable monitor, to display the value of e.g. the
> counter of a for-loop in the GUI of the c-program.
>
> The easiest implemetation for me would be to pass another c-function
> to lua which can be added in the script to pass the value of the
> desired variable and update the view. But this is also the least
> elegant solution ;)
>
> I read a bit into the lua-debug-facilities but i did not really
> understand if monitoring variables is possible with it.
>
> The third thing is the variable lua_getglobal. Is it possible to call
> it periodically in the C-programm while the script is running? I read
> the function takes the variable from the stack so i guess it is only
> valid to call lua_getglobal when the skript has finished?
>
> Thanks in advance for your help!
> (and sorry for my bad english ;)
>
> Greeting
> Steve
>