Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
How do you limit the line length of the output commands? Where ispqueue library documented?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Mason Kelsey, post: 4649328"] [Note: parts of this message were removed to make it a legal post.] There must be an easy way to solve the problem of controlling the length of the output line, forcing the rest into a line break. In the puts code example below, I want to break between every 10 methods or just go to a new line after every 60 characters that get displayed so they don't run off the screen. First Question: What is an easy way to modify the below puts code to control line length without truncation? require "pqueue" pq=PQueue.new(proc{|x,y| x[0][0]<y[0][0]}) puts pq.methods.join(', ') # Displays the methods of PQueue Class I've a tried puts, print, and p and they never do a word wrap or such. Is there a secret parameter for controlling the line length before word wrap occurs in these commands? Second question: The pqueue library is not documented in [URL]http://www.ruby-doc.org/stdlib/[/URL] <[URL]http://www.ruby-doc.org/[/URL]>. Is there a reason for that? Or is it cleverly hidden in a class that doesn't seem to have anything to do with priority queues? Thanks once more to the Ruby masters, No Sam [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
How do you limit the line length of the output commands? Where ispqueue library documented?
Top