BBS: Inland Empire Archive Date: 12-16-92 (09:30) Number: 298 From: CRUZ MONCIVAIS Refer#: NONE To: TERRY ROSSI Recvd: NO Subj: Word wrap code Conf: (2) Quik_Bas
-=> Quoting Terry Rossi to All <=-
TR> into two line in file B, I am able to do that but I cannot fiqure out
TR> a good way to do a word wrap. Right now the software breaks the line
TR> at column 79 regardless of where the word ends. I would like to have
TR> it break at the closest space to column 79 so the the next line begins
TR> with a complete word. Anybody have any ideas?
Terry:
Try this...
LOCATION% = 60
DO WHILE LOCATION%<=79
LASTLOCATION% = LOCATION%
LOCATION% = INSTR(LOCATION%,A$,CHR$(32))
LOOP
B$ = LEFT$(A$,LASTLOCATION%)
C$ = RIGHT$(A$,(LEN(A$)-LASTLOCATION%)
I am doing this from the top of my head so I am not entirely sure if
it will work as advertised. But it should point you in the right
direction.
-CRUZ- :)
... RAM = Rarely Adequate Memory
--- Blue Wave/RA v2.10 [NR]
* Origin: Greeley-Com-Net 303-351-8861 HST DS Greeley,CO
AKA 315/10 (1:315/6.0)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET