i'm doing it this way as the string will be grabbed from args ={ ... }
a = 1
function f(var)
--some how print 1 instead of a
end
f("a")
if at all possible i'd also prefer not to have to set it up as a dictionary
Posted 02 February 2013 - 07:45 AM
a = 1
function f(var)
--some how print 1 instead of a
end
f("a")
Posted 02 February 2013 - 08:02 AM
a = 1
function f(var)
local env = getfenv()
print(env[var])
end
f('a')
vars = {
a = 1
}
function f(var)
print(vars[var])
end
f('a')
print(vars['a'])
Posted 02 February 2013 - 08:05 AM
0 members, 1 guests, 0 anonymous users