lua-users home
lua-l archive

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


Example:

Lol={}
Lol.Write={}
Lol.Write.Version=001
print(Lol.Write.Version) --> print expected 1
Name='Write'
print(getglobal('Lol.'..Name..'.Version')) --> print nil ???

Needed for Robertos Ierusalimschy library suggestion (simple example):

do

   if Lol==nil then Lol={}

   local Public,Private={},{}

   Lol.Write=Public

   function Public.Initialise()

      %Public.Version = 001

   end

end


As also suggsted by Roberto I wouldn't like to use dostring() instead of
getglobal()


Markus