home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_11_1986_Transactor_Publishing.d64 / word-wrap (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  248b  |  12 lines

  1. 100 rem* recursive word-wrap routine *
  2. 110 rem*   put string in w$,
  3. 120 rem*    line width in w
  4. 130 :
  5. 140 if len(w$)>w then 160
  6. 150 print w$: return
  7. 160 p=0: for i=w to 1 step-1
  8. 170 if p=0 and mid$(w$,i,1)=" "then p=i
  9. 180 next: h$=right$(w$,len(w$)-p)
  10. 190 w$=left$(w$,p): gosub150
  11. 200 w$=h$: goto 140
  12.