283 posts
Posted 14 February 2015 - 04:51 AM
t = {fs.list(path)}
for i = 1, #t do
print(t[i])
end
doesn't return what i want
1080 posts
Location
In the Matrix
Posted 14 February 2015 - 04:59 AM
I believe fs.list returns a table. So basically you're seeing t[1] being a table.
t = fs.list(path)
for i = 1, #t do
print(t[i])
end
283 posts
Posted 14 February 2015 - 01:43 PM
I believe fs.list returns a table. So basically you're seeing t[1] being a table.
t = fs.list(path) for i = 1, #t do print(t[i]) end
that's the same thing i wrote down…whats wrong with the code i wrote?
570 posts
Posted 14 February 2015 - 02:04 PM
that's the same thing i wrote down…whats wrong with the code i wrote?
Your code:
t = {fs.list(path)}
Dragon's code:
t = fs.list(path)
1140 posts
Location
Kaunas, Lithuania
Posted 14 February 2015 - 02:06 PM
It's not the same code you wrote. What you are doing in your code is putting all return values of fs.list into a table, which you then save to a variable. What Dragon53535 is doing is putting the first (and only) return value into a variable. fs.list return a numerically indexed table, so there is no need to put it into another table.
283 posts
Posted 14 February 2015 - 02:16 PM
ohhhhh ok