900_____________________________________________ 14

int *elem;

qsort(array, ARRAYSIZE(array),sizeof(int), fcmp) ;

elem = (int *) bsearch (

&key, array, ARRAYSIZE(array), sizeof(int), fcmp);

if(elem == 0) ShowMessage(" " + IntToStr(key) + "  ");

else ShowMessage("  " + IntToStr(*elem) +
"  " + IntToStr(elem- array));

)

 Ifind  Isearch     .  -
,  ,      . -
  ,  Isearch,    ,    -
 .    Ifind  Isearch   
.          -
,   .

     Isearch,   -
 .     array   .
 fcmpi    .     Buttoni  -
  ,      Editl.
   ,     .

ftinclude <malloc.h>
ttinclude <stdlib.h>
int array[10] = {800,123,512,627,933,145};

unsigned Narray = 6;

int fcmpi (const void *pl, const void *p2)
{ return(*(int*)pi != *(int*)p2); }

void_fastcall TFormI::ButtonlClick(TObject *Sender)
{

int key = StrToInt(Editl->Text);

int *elem;

elem = (int *) Isearch (&key, array, &Narray, sizeof(int), fcmpi);

ShowMessage("  " + IntToStr(key) + "  " +
IntToStr(elem- array));

)

 GetShortHint  GetLongHint    
   

<  >|<  >

  ,  ,     Hint (.
 15).   ,    |, , .. -
     ,      .

      OnMouseMove, -
      . ,


void _fastcall TFormI::LabellMouseMove(

TObject *Sender, TShiftState Shift, int X, int Y)

(

Panell->Caption = GetShortHint(((TControl *)Sender)->Hint);

Panel2->Caption = GetLongHint(((TControl *)Sender)->Hint);

}

   Panell ,    Panel2    
Hint  ,    ,    -
   OnMouseMove   .     
   ShowHint.

     .   15   Hint.