Show/Hide Toolbars

XSharp

NoteThis command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available

Purpose

Create an empty structure-extended file.

Syntax

CREATE <xcTargetFile> [NEW] [ALIAS <xcAlias>] [VIA <cDriver>]

Arguments

<xcTargetFile>The name of the empty structure-extended database file, including an optional drive, directory, and extension.  See SetDefault() and SetPath() for file searching and creation rules.  The default extension for database files is determined by the RDD.  After the file is created, it remains open in the mode specified by the SetExclusive() flag for the work area.
 
If <xcTargetFile> does not exist, it is created.  If it exists, this command attempts to open the file in exclusive mode and, if successful, the file is overwritten without warning or error.  If access is denied because, for example, another process is using the file, NetErr() is set to TRUE.  
 
The structure of <xcTargetFile> is the same as the structure generated by COPY STRUCTURE EXTENDED, which you can refer to for more details.

 

NEWSelects the next unoccupied work area before opening <xcTargetFile>.  If this clause is not specified, the current work area is used.

 

ALIAS <xcAlias>An identifier name to associate with the work area when <xcTargetFile> is opened.  If this clause is not specified, the alias defaults to the database file name.  Duplicate alias names are not allowed within a single application.

 

VIA <cDriver>The name of the RDD that will service the work area.  If not specified, the default RDD as determined by RDDSetDefault() is used.

Notes

Unlike COPY STRUCTURE EXTENDED, the file created by CREATE is empty.  You must add records to the structure-extended file before you can use it to create a new database file with CREATE FROM.

Examples

This example creates a new structure-extended file, places the definition of one field into it, then creates a new database file from the extended structure:

 

CREATE tempstru
APPEND BLANK
REPLACE Field_Name WITH "Name",;
 Field_Type WITH "C",;
 Field_Len WITH 25,;
 Field_Dec WITH 0
CLOSE
CREATE newfile FROM tempstru

Assembly

XSharp.RT.DLL

See Also

COPY STRUCTURE EXTENDED, CREATE FROM, DbCopyStruct(), DbCreate(), RDDSetDefault(),SetDefault(), SetPath(), SetExclusive()