I have the database fields are: product code, name, model, price, manufacturer, date of receipt at the warehouse, the first to write a search function for its product code, here is my code, which does not come out:

Code:
function search_tov()
{
var temp,FoundIt,Posi,i;
inkey_active=0;str_cpy(mulkod,"                           ");inkey(mulkod);//str_cat(mulkod," "); //Ââîä êîäà òîâàðà
fhandle = file_open_read("Tovar.dll"); 
// FoundIt *= false;
//   while (Posi+1<=file_find(fhandle,mulkod) && !FoundIt)
//   {
//      file_seek(fhandle,Posi,0); 
//      //file_str_read(fhandle,mul2);
//      FoundIt*=(mul2=mulkod);
//      if (!FoundIt) Posi=Posi+1;
//   }
   //file_str_read( fhandle, (find_kod.pstring)[i] );
//for(i=0; i<j; i++)
//{
//	//txt_for_dir(sh_tov,mul2);
//   file_find(fhandle,mulkod);
//   file_str_read(fhandle,mul2);
//   if (mulkod=mul2)         
//   file_str_read( fhandle,(find_kod.pstring)[i] );   
//  }
FoundIt=0;
while(i<=j)
{
	file_str_read(fhandle,mulkod);
	file_find(fhandle,mul2); //mul2 it's a code of product in the programm.
	if (mulkod=i) file_str_read( fhandle,(find_kod.pstring)[i] ); 
	i=i+1;
}
file_close(fhandle);
}