Command COPY STRUCTURE Foundation
Copies the structure of the file in the current work area to a new file.
COPY STRUCTURE [FIELDS <cFieldname,...>] ;
TO <cFilename>
The command COPY STRUCTURE creates files using the field specifications of the current work area. If the file <cFilename> exists, it is overwritten without warning. The command is frequently used to create temporary files for data input or to store data subsets during some processes.
The functional equivalent of COPY STRUCTURE is the function DbCopyStruct().
// The example illustrates a typical use for the command
// COPY STRUCTURE. A temporary DBF file is created to
// store a subset of records. Operations are then
// performed using the subset and the temporary file is
// finally deleted.
PROCEDURE Main
USE Customer VIA "DBFNTX" NEW
COPY STRUCTURE TO Temp // generate temporary file
USE Temp
APPEND FROM Customer FOR "NEW YORK" $ Upper(CITY)
Browse() // operations on the subset
USE
ERASE Temp.dbf // delete temporary file
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.