Code: Select all
MAP={}
testmap={}
for i=1,10 do
MAP[i]={}
testmap[i]=1
for j = 1,10 do
MAP[i][j]=0
end
print(testmap[0]) --return nil
print(MAP[0][1]) --attempt to index a nil value,why?
end
the result should be “nil” too.
thks
Code: Select all
MAP={}
testmap={}
for i=1,10 do
MAP[i]={}
testmap[i]=1
for j = 1,10 do
MAP[i][j]=0
end
print(testmap[0]) --return nil
print(MAP[0][1]) --attempt to index a nil value,why?
end
Users browsing this forum: Amazon [Bot], Bing [Bot] and 5 guests