lua-users home
lua-l archive

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

Thanks for pointing me to this book. i think the method shown in the
book is not exactly what i need. the tracing of variables should be as
transparent as possible to the writer of the lua code. tracing the
global variables of the script would be enough and it should be as easy
as one call like "tracevars(varname1, varname2)" and everything else is
handled in the background.
as the lua-code in my projekt is input in a textfield i could of course
preprocess the code before sending it to lua.

is this possible?

Stephen Kellett schrieb:
> 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