>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