[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Monitoring variables of a running script from c
- From: Stevo <steve.bn@...>
- Date: Sat, 6 Dec 2008 11:55:00 +0100
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 ;)