Delphi Examples: DbiGetIndexDesc

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Delphi Examples: DbiGetIndexDesc

Return to chapter overview

Get the properties of a specific index associated with a cursor:

This function returns the IDXDesc properties specified by the IndexName parameter of TTable T's index.

 

function GetIndexDesc(T: TTable; IndexName: String): IDXDesc;

var

 hNewCur: hDbiCur;

 iIndexId: LongInt;

 InfoStr: String;

 pInfoStr: array[0..100] of char;

begin

 Check(DbiCloneCursor(T.Handle, False, False, hNewCur));

try

   iIndexId := 1;

   Check(DbiSwitchToIndex(hNewCur, PChar(IndexName), nil, iIndexId, False));

   Check(DbiGetIndexDesc(hNewCur, 0, Result)); //'0' specifies the active index

finally

   Check(DbiCloseCursor(hNewCur));

end;

end;