[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'db' (#fcl)

# TIndexDefs.Add

Add a new index definition with given name and options

## Declaration

Source position: db.pas line 1006

`public procedure TIndexDefs.Add(`
`const Name: String;`
`const Fields: String;`
`Options: TIndexOptions`
`);`

## Arguments

`Name` |  | Name for the new index definition
`Fields` |  | Value for the Fields property of the new index definition.
`Options` |  | Value for the Options property of the new index definition.

## Description

Add adds a new TIndexDef instance to the list of indexes. It initializes the index definition properties Name, Fields and Options with the values given in the parameters with the same names.

## Errors

If an index with the same Name already exists in the list of indexes, an exception will be raised.

## See also

TIndexDef |  | Index definition
TNamedItem.Name |  | Name of the item
TIndexDef.Fields |  | Fields making up the index
TIndexDef.Options |  | Index options
TIndexDefs.AddIndexDef |  | Add a new, empty, index definition

The latest version of this document can be found at lazarus-ccr.sourceforge.net .