[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: executing dostring on 'local' level
- From: "Roman Vanicek" <vanicek@...>
- Date: Sat, 10 Mar 2001 09:58:03 +0100
is there a way do execute dostring in Lua on the 'local' level? The example
goes like this:
a = 0; -- global 'a'
local a = 0; -- local 'a'
dostring("a=1;"); -- now dostring will set global 'a' to 1 just as there
were no local 'a'
print(a); -- this will print 0, since local 'a' has not been touched
print(a); -- this will print 1, since dostring did set the global 'a'
Maybe this behavior is intentional, but in this case I would feel good if
someone would explain to me why it is so.