This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
anonimo182's profile picture

[QUESTION] [LUA] Tables

Started by anonimo182, 12 October 2012 - 11:12 PM
anonimo182 #1
Posted 13 October 2012 - 01:12 AM
How can I list the files that this code throws:


  list = fs.list("programs")
And them list them in order verically and if there are more than "x", it goes to the next lane, and so…
Lyqyd #2
Posted 13 October 2012 - 01:18 AM
Check out the "ls" (or "list", can't recall which name it uses) program included with ComputerCraft. You'll see that it passes that list to one of the textutils functions. The API's wiki page should be able to help you out on which one of them best suits your needs.
anonimo182 #3
Posted 13 October 2012 - 02:36 AM
ok, thanks!
anonimo182 #4
Posted 13 October 2012 - 03:04 AM
It doesn't work!, Please help me with that code!
Lyqyd #5
Posted 13 October 2012 - 06:08 AM
So, you're doing something like this:


local list = fs.list("/programs")
textutils.pagedTabulate(list)

And list is returning as a table containing at least one entry?
anonimo182 #6
Posted 13 October 2012 - 05:38 PM
I need the way to do that, so I just need to make that exact code you made?
So, you're doing something like this:


local list = fs.list("/programs")
textutils.pagedTabulate(list)

And list is returning as a table containing at least one entry?
Lyqyd #7
Posted 13 October 2012 - 06:23 PM
I need the way to do that, so I just need to make that exact code you made?
So, you're doing something like this:


local list = fs.list("/programs")
textutils.pagedTabulate(list)

And list is returning as a table containing at least one entry?

Yes. But if you didn't know what to do, why did you say it didn't work in your last post?
anonimo182 #8
Posted 13 October 2012 - 07:35 PM
I finally solved, thanks!