lua-users home
lua-l archive

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


Thanks for you information Rici. However a couple of things are still
confusing me. 

You mentioned that variables declared in a particular chunk (and I am
assuming one compiled LUA file/string as one chunk, am I correct?), as
global within that chunk and not so to the whole lua state, but then how
come I can get the value of these variables via lua_getglobal(...). 

Consider the following scripts:

Test1.lua:

Tmp = 100

Test2.lua:

Tmp = 200

I execute test1 first and then test2. When I query the value of Tmp
variable using lua_getglobal after executing the scripts once, it comes
out to be 200. Is there a way (if yes, then what?) with which I can
query the value of the variable Tmp, first for script test1 and then for
script test2 and get the proper values respectively (i.e. 100 and 200 in
this case). Can someone help me in this regard? Thanks in advance.

Regards,
Zulfiqar Inayat Malik.