[Solved] Am I overlooking something?
Posted: Wed Oct 29, 2014 4:00 am
Why does this work?
######## RESULTS ##########
it is a string
table
And this does not work?
######## RESULTS ##########
making headway
it is a string
nil
I can really use some expertise on this, please.
Code: Select all
function echoFunc()
workdamnit("green")
end
function workdamnit(yyz)
local yyzType = type(yyz)
local a;
if yyzType == "string" then
print("it is a string")
a = {}
table.insert(a, yyz)
end
print(type(a))
end
it is a string
table
And this does not work?
Code: Select all
function echoFunc()
workdamnit("green")
end
function workdamnit(yyz)
if yyz ~= nil then
print("making headway")
local yyzType = type(yyz)
local a;
if yyzType == "string" then
print("it is a string")
a = {}
table.insert(a, yyz)
end
end
print(type(a))
end
making headway
it is a string
nil
I can really use some expertise on this, please.