Subject Re: copy to <file> fields
From Theo Scheffers <theo.schaffers@dohsbase.nl>
Date Mon, 20 Feb 2017 17:11:49 -0500
Newsgroups dbase.getting-started



Charlie Wrote:

> Hi Mervyn,
>
> Thanks very much for the info.  
>
> What was happening was strange.  I would copy to the file and specify the fields I wanted to copy.  It seemed to want to copy all or nothing in many cases.  Pretty sure I had it coded correctly.  I have this set in another app and it seems to work fine.  I don't know possibly more ghosts or something!
>
> At any rate the frustration got to me so before I saw your post I wrote a do, enddo with a loop and replaced the fields I wanted.  This might be a little slower, but it sure works well.  Very strange though... I don't know why it wasn't working in the copy to command.  So I just make a temporary table with the selected fields and copy that to the text file.  Since that's not filtered it works well.
>
> Think I'm going to take a break from this for a while.  I love coding, but not sure it is good for my health! :)
>
> Charlie

I'm encountering the same problem as Charly
If I open a file with 8 fields (see // browse) and I filter only the records of field handel16 which are filled and then try to copy three fields with the selected records to a new file, then the copy command only creates an empty file with the fields specified.
The same occurs if you use a FOR statement in stead of the filter
According to the help this is allowed
See code below.
This is indeed not good for Health!
Theo
P.S. This does not happen if you don't use a set filter

use exclusive SYN_naam
// browse field casnr, naam3/80, naam/80, handel15/60,  handel16/60,  handel17/60,  handel18/60,  handel19/60
SET filter TO isblank(handel16)=false
go top
copy to SYN_handel16 fields casnr,naam, handel16