[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Global variables, and lua states
- From: "Zulfiqar Malik" <Zulfiqar.Malik@...>
- Date: Mon, 30 May 2005 12:08:24 +0500
Thanks for you information Rici. However a couple of things are still
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:
Tmp = 100
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.
Zulfiqar Inayat Malik.