>I have a Memo field that was built from a text file.
>I wish to read the Memo field and break it into separate text files.
>For example, the first text file would be 60 lines;
>the second text file would be 60 lines;
>the third text file would be 60 lines and so on.
>
>The reason I need to do this is so I can fax the (former Memo field,
>now text files) as separate faxed pages.
>
>Any ideas? I know how to use APPEND MEMO and COPY MEMO, but I can't
>find a good way to do this. Thanks for your help.
You could use this function.
use mytable
myWidthpreference = 80
=Splitmemo("myMemo","myoutput",60,myWidthpreference)
function SplitMemo
lparameters pcMemoFname,pcOutPut, pnLines, pnWidth
lnFiles = ceiling(memlines(&pcMemoFname)/pnLines)
lnOldWidth = set("memowidth")
if type("pnWidth")="N"
set memowidth to pnWidth
endif
for ix=1 to lnFiles
store fcreate(pcOutPut+padl(ix,2,"0")+".txt") ;
to ("lnHandle"+padl(ix,2,"0"))
endfor
for ix = 1 to memlines(&pcMemoFname)
=fputs(eval("lnHandle"+padl(ceiling(ix/pnLines),2,"0")),;
mline(&pcMemoFname,ix))
endfor
for ix=1 to lnFiles
=fclose(eval("lnHandle"+padl(ix,2,"0")))
endfor
set memowidth to lnOldWidth
Cetin