C5_COPY STRUCTURE

 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



2 responses to “C5_COPY STRUCTURE

  1. Pingback: DB Commands | Viva Clipper !

  2. Pingback: C5 Commands | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.