Starting with the following in my scene
print(“going in”)----> going in
print(pwValue[3].value) ----> 2014
if util.leapyear(pwValue[3].value)
in utility module
function M:leapyear(year)
print(“you are in”)----> you are in
print("year is "…year)
local yr = tonumber(year)
print(tostring(yr%4))
print(tostring(yr))
local leap = “No”
if(yr%4) == 0 and (yr%100~=0 or yr%400==0) then
leap = “Yes”
end
print(leap)
return leap
end
results in
going in
2014
you are in
Runtime error
/Users/rvergin/Library/Application Support/Outlaw/Sandbox/11/utilityfunctions.lua:237: attempt to concatenate local ‘year’ (a nil value)
Why is it nil?