Posted 03 September 2012 - 11:16 AM
Okay, before I start, I have had a look for this all over google, but to be honest I'm not quite sure what to search for.
okay, so I have a directory and inside it are, let's say, 6 files, but this might change such that today it's 6 files, tomorrow its 8, the day after it's 4.
fileA, fileB etc….
I can print the files with:
and this would give me a list with all the files in them. hooray!
but what I want is each value assigned to a variable, so that var1= "fileA", var2 = "fileB" and so on…
There might be a really simple way to do this but I think I'm missing something….
okay, so I have a directory and inside it are, let's say, 6 files, but this might change such that today it's 6 files, tomorrow its 8, the day after it's 4.
fileA, fileB etc….
I can print the files with:
Table = fs.list("\file")
for i =1,#table do
write( table[i])
write("\n")
end
and this would give me a list with all the files in them. hooray!
but what I want is each value assigned to a variable, so that var1= "fileA", var2 = "fileB" and so on…
There might be a really simple way to do this but I think I'm missing something….