Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy to File with memo
Message
From
16/05/2001 09:46:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00507772
Message ID:
00507777
Views:
9
>I'm trying to copy a table to a txt file but the command doesn't seem to copy the memo field. I've tried:
>
>copy to (lcFile) deli with ; with character tab
>
>(I do it this way because I then run:
>
> STRTOFILE(STRTRAN(FILETOSTR([&lcFile]), [;], []), [&lcFile])
>
>to get a tab delimeted file with no quotes).
>
>I even tryed:
>
>copy to (lcFile) fields field1, memofld, field3, etc...
>
>And that didn't work either. Any suggestions on how to copy a table to a text file and include memos?
>
>TIA!
>
>Rob

Rob,
There is no 'copy to' command that'd copy memo fields. You should use lowlevel io :
#define TABULATE chr(9)
#define CRLF chr(13)+chr(10)
handle=fcreate(forceext(tcTable,'OUT'))
scan
 for ix = 1 to fcount(tcTable)
  lcField = field(ix)
  =fwrite(handle,transform(&lcField)+iif(ix<fcount(tcTable),TABULATE,CRLF))
 endfor
endscan
=fclose(handle)
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