p>
DELIMITED [WITH WITH BLANK | WITH TAB]]]
Remarks
If an index order is set, records are copied in master index order.
Clauses
The name of the new file to which COPY TO copies data is specified with . If you do not include an extension with the file name, the default extension for the specified file type is assigned. If you do not specify a file type, COPY TO creates a new table/.DBF and assigns the table/.DBF file name the default extension. DBF. br/>
FIELDS
If you include FIELDS and a field list, you can specify which fields are copied to the new file. If the FIELDS clause is omitted, all fields are copied to the file. If the file you are creating is not a database, memo fields aren't copied to the new file even if memo field names are included in the field list.
The scope clauses are: ALL, NEXT , RECORD , and REST. These are explained in the Overview of the FoxPro Language chapter in the FoxPro Language Reference. Commands which include operate only on the table/.DBF in the active work area.
You can specify a scope of records copied to a file. Only the records that fall within the range of records specified by the scope are copied.
The default scope for COPY TO is ALL records.
FOR
If the FOR clause is included, only the records for which the logical condition evaluates to true (. T.) are copied to the file. Include FOR to conditionally copy records, filtering out undesired records. p> Rushmore optimizes COPY TO with a FOR clause if is an optimizable expression. For best performance, use an optimizable expression in the FOR clause. A discussion of Rushmore optimizable expressions appears in the Optimizing Your Application chapter in the FoxPro Developer's Guide. br/>
WHILE
If WHILE is included, records are copied as long as the logical expression evaluates to true (. T.).
[WITH] CDX | [WITH] PRODUCTION
If the table/.DBF you copy from has a structural index file, you can create a structural index file for the new table/.DBF. Including CDX or PRODUCTION creates an identical structural index file for the new table/.DBF. The tags and index expressions from the original structural index file are copied to the new structural index file. The CDX and PRODUCTION clauses have the same effect.
Do not include CDX or PRODUCTION if you are copying to a file other than a new FoxPro table/.DBF. br/>
NOOPTIMIZE
Include NOOPTIMIZE to cause Rushmore to not optimize COPY TO. For more information, see SET OPTIMIZE or consult the discussion of Rushmore optimization in the Optimizing Your Application chapter in the FoxPro Developer's Guid...