Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Memo field
Message
From
14/08/1998 10:20:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00126885
Message ID:
00126906
Views:
21
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform