i am trying to return a table from a function.
for example..
function test(user)
local uVars = {}
uVars = getVars();
gData.."\t"..uVars.var1.."\r\n"
return gData;
end
function getVars()
local var = {
var1 = "value",
}
return var;
end
when i try to access the returned value, i get the error:
attempt to concatenate field `var1' (a nil value)
what am i doing wrong? tia
-st0ne-db-
function test(user)
local uVars = getVars();
gData.."\t"..uVars.var1.."\r\n" -- wtf is this???
return gData;
end
function getVars()
local var = {
var1 = "value",
}
return var
end
QuoteOriginally posted by bastya_elvtars
function test(user)
local uVars = getVars();
gData = uVars.var1
return gData;
end
function getVars()
local var = {
var1 = "value",
}
return var
end
im not trying to run this code... im just trying to describe what i want to do. sorry if this is a confusing example. ?(
local uVars = getVars();
Just shortened... :)
thx, is working perfectly now :)