home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 September / Personal_Computer_World_Sep_97.iso / DXRS / SLIPCW09.DXR / 00006_tidyuptext.ls < prev    next >
Encoding:
Text File  |  1997-06-27  |  935 b   |  26 lines

  1. on tidyuptext fieldName
  2.   global filetextlist, foundline
  3.   set filetextlist to list()
  4.   repeat with i = 1 to the number of lines in field fieldName
  5.     set foundline to line i of field fieldName
  6.     if charToNum(char 1 of foundline) = 10 then
  7.       set foundline to char 2 to the number of chars in foundline of foundline
  8.     end if
  9.     if charToNum(char the number of chars in foundline of foundline) = 13 then
  10.       set foundline to char 1 to the number of chars in foundline - 1 of foundline
  11.     end if
  12.     append(filetextlist, foundline)
  13.   end repeat
  14.   set tempfieldstring to EMPTY
  15.   put EMPTY into field fieldName
  16.   repeat with i = 1 to count(filetextlist)
  17.     if i < count(filetextlist) then
  18.       put getAt(filetextlist, i) & RETURN after tempfieldstring
  19.       next repeat
  20.     end if
  21.     put getAt(filetextlist, i) after tempfieldstring
  22.   end repeat
  23.   put tempfieldstring into field fieldName
  24.   set tempfieldstring to EMPTY
  25. end
  26.