home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / dbadv.zip / WRAP.PRG < prev   
Text File  |  1986-02-25  |  640b  |  30 lines

  1. *start a new print line
  2. ?
  3. *
  4. *set the printing pointer to the beginning of the line
  5. STORE 0 TO printed
  6. *
  7. * process the entire string
  8. &firstchar
  9. do while .NOT. &ENDSTRING
  10.   *
  11.   * get the next word
  12.   DO word
  13.   *
  14.   *if the word won 't fit on the same line
  15.   *start a new line
  16.   IF len(newstring) + printed > MARGIN
  17.     ?
  18.     STORE 0 TO printed
  19.   ENDIF len(newstring) + printed > MARGIN
  20.   *
  21.   *print the word without a carriage return
  22.   ?? newstring
  23.   *
  24.   *increase the printing pointer
  25.   STORE len(newstring) + printed + 1 TO printed
  26. ENDDO WHILE .not. &endstring 
  27. *
  28. *clean up
  29. RELEASE printed,newstring
  30.