lua-users home
lua-l archive

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

On 23-Sep-04, at 9:08 AM, Florian Berger wrote:

Rici Lake wrote:
Perhaps you need to be clearer about what it is you are trying to accomplish?

Sorry. It seems like I'm not good in explaining things. :)

I give an example, hopefully it explains better what I would like to accomplish.

I want execute a file containing Lua code. The file could for example contain following code:
a = 1
a = a + 1

My fictional hooking function would control every line executed. So when first line is executed the function gets string "a = 1" and possibly other information. At second line it gets string "print(a)" etc. Now if my function accepts (for undefined reasons) parameter string it executes it instead of Lua. So if the function would not accept the first line there would be no variable "a". If hooking function does not execute string so does not Lua.

That's not really possible, since Lua compiles the program before executing it.

I think you need to come up with a less general concept than "for undefined reasons", which is what I meant when I said "you need to be clearer". If there are particular things you want to control, that may be possible, depending on what they are.