Creates a reference to a DbfIndex object for local tables

Syntax

[<oRef>]=new DbfIndex( <indexname expC>,<expression expC> )

<oRef>

A variable or property in which to store a reference to the newly created DbfIndex object.

<indexname expC>

The name of the index tag for the index

<expression expC>

A dBL expression of up to 220 characters that includes field names, operators, or functions

Properties

The following tables list the properties of the DbfIndex class. No events or methods are associated with this class. For details on each property, click on the property below.

Property

Default

Description

baseClassName

DBFINDEX

Identifies the object as an instance of the DbfIndex class

className

(DBFINDEX)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

descending

False

Creates the index in descending order (Z to A, 9 to 1, later dates to earlier dates). Without DESCENDING, DbfIndex creates an index in ascending order.

expression

Empty string

A dBASE expression of up to 220 characters that includes field names, operators, or functions.

forExpression

Empty string

Limits the records included in the index to those meeting a specific condition.

indexName

Empty string

Specifies the name of the index tag for the index

parent

null

Container, form or report

type

0(MDX)

Identifies the index type. 0=MDX, 1=NDX

unique

False

Prevents multiple records with the same expression value from being included in the index. dBASE Plus includes only the first record for each value.

Description

DbfIndex( ) is a subclass of INDEX( ) created specifically for use with DBF tables. If you are using Paradox or SQL tables, see class Index. Use DbfIndex( ) to store a reference in a newly created DbfIndex object. A DbfIndex object requires setting only two properties, indexName and expression. However you may find others, such as descending or unique, particularly helpful. Once you've referenced a DbfIndex object, it's easy to create a new index for your table using the database class method: createIndex( ).

indexName

Feel free to name the index whatever you choose. It may be helpful, however, to select an index name that provides some indication of it's function.

Index order (Ascending vs. Descending)

Character keys are ordered in ASCII order (from A to Z, and then a to z); numeric keys are ordered from lowest to highest; and date keys are ordered from earliest to latest (a blank date is higher than all other dates).