       531

     CBdep.    -
    .      ,   -
 ,    Tablel->Eof.   -
      Dep,    Next  -
   .        -
       .

9.11.6  

           -
   .     , -
   SetKey, FindKey, Lookup  Locate.

   SetKey.      -
     ,      -
.       dsSetKey.   -
  SetKey.   dsSetKey    -
       ,   -
  .     dsSetKey  -
       
.    GotoKey    ,  
    .    ,  
    .     ,  -
 GotoKey  false.        
GotoKey,   GotoNearest.       ,
       . ..    ,
   .  GotoNearest     
.         ,    -
      .

,      ,     (
Year_b)       EYear,  
 :

Tablel->IndexFieldNames = "Year b";

Tablel->SetKey() ;

Tablel->FieldByName("Year_b")->AsString = EYear->Text;

if (! Tablel->GotoKey())
ShowMessage("  ");

       Year_b,  -
     dsSetKey,    ,  
         -
 .

         ,  -
    EFam,    :

Tablel->IndexFieldNames = "Fam";

Tablel->SetKey() ;

Tablel->FieldByName("Fam")->AsString = EFam->Text;

Tablel->GotoNearest() ;

      ,     -
 (   ).

  FindKey     .   -
         ,  -
  .  FindKey   :

bool _fastcall FindKey(const System::TVarRec * KeyValues,
const int KeyValues_Size);