In the previous previous question, you used ttASCIIhow TableType. ttASCIItables, AFAIK, do not support indexes.
It is best to load content ttASCII TTableinto TClientDataset` (CDS), which supports indexes. I have not tested the ttASCII table as a source, but it should be as simple as:
TDatasetProvider. DataSet TTable.
TClientDataSet. ProviderName DataSetProvider, . ( CDS .)
Table ClientDataSet (CDS) .
Table1.Active := True;
CDS.Active := True;
TTable, . ( .)
CDS.LogChanges := False;
:
// Repeat for each additional index
with CDS.IndexDefs.AddIndexDef do
begin
Name := 'ndxHits';
Fields := 'Hits';
Options := [];
end;
ClientDataSet's IndexName , :
CDS.IndexName := 'ndxHits';
ClientDataSet, . Locate FindKey, Insert Append, ..