Jump to content




[QUESTION] [LUA] Tables


  • You cannot reply to this topic
7 replies to this topic

#1 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 13 October 2012 - 12: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...

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 13 October 2012 - 12: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.

#3 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 13 October 2012 - 01:36 AM

ok, thanks!

#4 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 13 October 2012 - 02:04 AM

It doesn't work!, Please help me with that code!

#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 13 October 2012 - 05: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?

#6 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 13 October 2012 - 04:38 PM

I need the way to do that, so I just need to make that exact code you made?

View PostLyqyd, on 13 October 2012 - 05:08 AM, said:

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?


#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 13 October 2012 - 05:23 PM

View Postanonimo182, on 13 October 2012 - 04:38 PM, said:

I need the way to do that, so I just need to make that exact code you made?

View PostLyqyd, on 13 October 2012 - 05:08 AM, said:

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?

#8 anonimo182

  • Members
  • 252 posts
  • LocationIn the universe

Posted 13 October 2012 - 06:35 PM

I finally solved, thanks!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users