Text wrapping
Author |
Message |
Mayb123
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
richcash
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
|
|