Command CREATE Foundation
Creates and opens an empty structure extended DBF file.
CREATE <cFilename>
The file command CREATE creates an empty structure extended file with the name <cFilename> and opens it in the current work area. A structure extended file contains in its records the field definitions for another file. The fields of a structure extended file are shown in the following table:
Field name | Field type | Field length | Decimal places |
---|---|---|---|
FIELD_NAME | Character | 10 | 0 |
FIELD_TYPE | Character | 1 | 0 |
FIELD_LEN | Numeric | 5 | 0 |
FIELD_DEC | Numeric | 4 | 0 |
New databases can be created from the records of a structure extended file. This is done using the command CREATE FROM. Databases can also be created using the function DbCreate(). This function uses a two dimensional array instead of a file for information on the field definitions.
The function CreateExtStruct() is the functional equivalent of the command CREATE.
// The example demonstrates how files can be created
// using CREATE and CREATE FROM.
PROCEDURE Main
CREATE Struct
APPEND BLANK
REPLACE FIELD_NAME WITH "UserID" , ;
FIELD_TYPE WITH "C" , ;
FIELD_LEN WITH 5 , ;
FIELD_DEC WITH 0
APPEND BLANK
REPLACE FIELD_NAME WITH "UserName" , ;
FIELD_TYPE WITH "C" , ;
FIELD_LEN WITH 30 , ;
FIELD_DEC WITH 0
CLOSE
CREATE Login FROM Struct
ERASE Struct.dbf
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.