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

# TIndexDefs.GetIndexForFields

Get index definition based on field names

## Declaration

Source position: db.pas line 959

`public function TIndexDefs.GetIndexForFields(`
`const Fields: String;`
`CaseInsensitive: Boolean`
`):TIndexDef;`

## Arguments

`Fields` |  | Fieldlist to look for
`CaseInsensitive` |  | Look only for a case-insensitive index

## Function result

TIndexDef instance with fieldlist matching Fields or Nil

## Description

GetIndexForFields searches in the list of indexes for an index whose TIndexDef.Fields property matches the list of fields in Fields. If CaseInsenstitive is True it only searches for case-sensitive indexes. If it finds an index definition, then it returns the found instance. If it does not find a matching definition, Nil is returned.

## See also

TIndexDef |  | Index definition
TIndexDefs.Find |  | Find an index by name
TIndexDefs.FindIndexForFields |  | Find index definition based on field names

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