CREATE
Create empty structure extended file
- Syntax
-
- CREATE <xcFileName> [VIA <xcRDDName>] [ALIAS <xcAlias>]
- Arguments
-
- <xcFileName> is the target file name to create and then open. (.dbf) is the default extension if none is given. It can be specified as literal file name or as a character expression enclosed in parentheses.
- VIA <xcRDDName> is RDD name to create target with. If omitted, the default RDD is used. It can be specified as literal name or as a character expression enclosed in parentheses.
- ALIAS <xcAlias> is an optional alias to USE the target file with. If not specified, alias is based on the root name of <xcFileName>.
- Description
-
- CREATE a new empty structure extended file with the name <cFileName> and then open it in the current work-area. The new file has the following structure:
Field name | Type | Length | Decimals |
|
FIELD_NAME | C | 10 | 0 |
FIELD_TYPE | C | 1 | 0 |
FIELD_LEN | N | 3 | 0 |
FIELD_DEC | N | 3 | 0 |
- CREATE command is preprocessed into __dbCopyStruct() function during compile time and use this mode.
Examples
// CREATE a new structure extended file, append some records and
// then CREATE FROM this file a new database file
CREATE template
APPEND BLANK
FIELD->FIELD_NAME := "CHANNEL"
FIELD->FIELD_TYPE := "N"
FIELD->FIELD_LEN := 2
FIELD->FIELD_DEC := 0
APPEND BLANK
FIELD->FIELD_NAME := "PROGRAM"
FIELD->FIELD_TYPE := "C"
FIELD->FIELD_LEN := 20
FIELD->FIELD_DEC := 0
APPEND BLANK
FIELD->FIELD_NAME := "REVIEW"
FIELD->FIELD_TYPE := "C" // this field is 1000 char long
FIELD->FIELD_LEN := 232 // 1000 % 256 = 232
FIELD->FIELD_DEC := 3 // 1000 / 256 = 3
CLOSE
CREATE TV_Guide FROM template
- Status
- Ready
- Compliance
-
- CREATE works exactly as in CA-Clipper
- Platforms
-
- All
- See Also