[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
COPY STRUCTURE
Copy the current .dbf structure to a new database (.dbf) file
------------------------------------------------------------------------------
Syntax
COPY STRUCTURE [FIELDS <idField list>]
TO <xcDatabase>
Arguments
FIELDS <idField list> defines the set of fields to copy to the new
database structure in the order specified. The default is all fields.
TO <xcDatabase> is the name of the target database file and can be
specified either as a literal database file name or as a character
expression enclosed in parentheses. The default extension is .dbf
unless another is specified.
Description
COPY STRUCTURE is a database command that creates an empty database file
with field definitions from the current database file. If <xcDatabase>
exists, it is overwritten.
COPY STRUCTURE creates empty structures that can be used to archive
records from the current database file or to create a temporary database
file for data entry.
Examples
. In this example, COPY STRUCTURE creates a temporary file.
After the user enters data into the temporary file, the master
database file is updated with the new information:
USE Sales NEW
COPY STRUCTURE TO Temp
USE Temp NEW
lMore := .T.
DO WHILE lMore
APPEND BLANK
@ 10, 10 GET Temp->Salesman
@ 11, 11 GET Temp->Amount
READ
IF UPDATED()
SELECT Sales
APPEND BLANK
REPLACE Sales->Salesman WITH Temp->Salesman
REPLACE Sales->Amount WITH Temp->Amount
SELECT Temp
ZAP
ELSE
lMore := .F.
ENDIF
ENDDO
CLOSE DATABASES
Files Library is CLIPPER.LIB.
See Also:
COPY STRU EXTE
CREATE
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson