XBaseFieldsCollection.Add

Syntax:

Add(<Name>, <Type>, <Length>, <Precision>)

Parameters:

<Name> (required)

Type: String.
Name of the field being added. Supported only for Latin field names containing up to 10 characters.

<Type> (required)

Type: String.
Type of field being created: "N" - number, "S" - string, "D" - date, "L" - Boolean, "F" - analogous "N" - number, "M" - memo field (not supported).

<Length> (optional)

Type: Number.
Total length of the field being created.
Required for fields of 'N', 'F' and 'S' types. Not required for fields of 'D' and 'L' types (default value is 0).

<Precision> (optional)

Type: Number.
Length of a fractional part (only for numerical fields).
Default value: 0.

Description:

Adds a new field to the description of a database table structure.

Availability:

Server, thick client, external connection.

Example:

xB.Fields.Add("CODE", "S", 5);
xB.Fields.Add("NAME", "S", 40);
xB.Fields.Add("COST", "N", 14, 2);
xB.CreateFile("c:\test.dbf");

See also:

XBase, method CreateFile
XBaseIndexesCollection, method Add

    

1C:Enterprise Developer's Community