Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Text wrapping
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mayb123




PostPosted: Wed Dec 19, 2007 1:08 pm   Post subject: Text wrapping

Hey everyone. does anyone know how to keep long pieces of text from clipping at the right side of the run window and to continue on the next line?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Dec 19, 2007 1:17 pm   Post subject: RE:Text wrapping

Print text one word at a time, check to see if there's enough space left on the line (maxcol - text printed so far) for the next word to fit. Otherwise linebreak with \n (or put "") and continue.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
richcash




PostPosted: Wed Dec 19, 2007 1:24 pm   Post subject: Re: Text wrapping

You'll probably also need the length function which returns the length of a string.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: