Word wrap: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: added the REXX language. -- ~~~~) |
|||
Line 152: | Line 152: | ||
| it shone in her face. |
| it shone in her face. |
||
</pre> |
</pre> |
||
Without Browser |
|||
<lang runbasic>doc$ = "In olden times when wishing still helped one, there lived a king ";_ |
|||
"whose daughters were all beautiful, but the youngest was so beautiful ";_ |
|||
"that the sun itself, which has seen so much, was astonished whenever ";_ |
|||
"it shone in her face." |
|||
input "Width"; width |
|||
while word$(doc$,i + 1," ") <> "" |
|||
i = i + 1 |
|||
thisWord$ = word$(doc$,i," ") + " " |
|||
if len(docOut$) + len(thisWord$) > width then |
|||
print docOut$ |
|||
docOut$ = "" |
|||
end if |
|||
docOut$ = docOut$ + thisWord$ |
|||
wend |
|||
print docOut$</lang> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |