XBaseIndexesCollection.Add

Syntax:

Add(<Name>, <Expression>, <Unique>, <Descending>, <Filter>)

Parameters:

<Name> (required)

Type: String.
Name of index being created. Only Latin index names of up to 10 characters are supported.

<Expression> (required)

Type: String.
Index expression.

<Unique> (optional)

Type: Boolean.
Unique flag for the index being created. True - unique; False - non-unique.
Default value: False.

<Descending> (optional)

Type: Boolean.
Defines whether or not the index being created is descending. True - descending; False - ascending.
Default value: False.

<Filter> (optional)

Type: String.
Index filter expression.
Default value: ".T.".

Description:

Adds a new index to the collection of database table indices.

Availability:

Server, thick client, external connection.

Example:

xB = New xBase;
xB.Fields.Add("CODE", "S", 5);
xB.Fields.Add("NAME", "S", 40);
// Add index by the CODE field:
xB.Indexes.Add("IDXCODE","CODE", True);
xB.CreateFile("c:\test.dbf", "c:\test.cdx");


    

1C:Enterprise Developer's Community