               Printing a Field on Multiple Lines

     The following dBASE III routine can be used to print a field on
multiple lines.  Each field that is passed to the program will be split
into substrings of the specified length or shorter.  Words will not be
split.  The substrings will be printed starting at the row/column
coordinates.  Syntzx to call the program is:

DO WRAP WITH fieldname, length, row, col

* Program:  WRAP.PRG
parameters string, length, row, col

strlen = LEN(string)
DO WHILE strlen > length
  spot = length
  * Do not divide a word
  DO WHILE SUBSTR (string, spot, 1) # " "
    spot = spot - 1
  ENDDO
  @ row, col SAY SUBSTR(string, 1, spot - 1)
  row = row + 1
  string = SUBSTR(string, spot+1, strlen-spot)
  strlen = LEN(string)
ENDDO
@ row, col SAY string
RETURN
